It helps to allocate enough memory for 40 LONGs, and that memory needs to be returned

regardless as passing a NULL to chooser.gadget crashes it.

svn path=/trunk/netsurf/; revision=9757
This commit is contained in:
Chris Young 2009-12-23 13:47:50 +00:00
parent a3d82a3634
commit f23a285103

View File

@ -1748,12 +1748,12 @@ STRPTR *ami_gui_opts_websearch(void)
ULONG ref = 0;
STRPTR *websearchlist;
if (option_search_engines_file == NULL) return NULL;
websearchlist = AllocVec(200, MEMF_CLEAR);
if (option_search_engines_file == NULL) return websearchlist;
FILE *f = fopen(option_search_engines_file, "r");
if (f == NULL) return NULL;
websearchlist = AllocVec(40, MEMF_CLEAR);
if (f == NULL) return websearchlist;
while (fgets(buf, sizeof(buf), f) != NULL) {
if (buf[0] == '\0') continue;