Avoid potential NULL deference

svn path=/trunk/netsurf/; revision=9688
This commit is contained in:
John Mark Bell 2009-11-22 13:52:16 +00:00
parent 81c1b0e0df
commit eba224e09e
1 changed files with 5 additions and 3 deletions

View File

@ -619,9 +619,11 @@ char *fetchcache_parse_type(const char *s, char **params[])
return type;
no_memory:
for (i = 0; i != MAX_ATTRS * 2 + 2; i++)
free((*params)[i]);
free(*params);
if (*params != NULL) {
for (i = 0; i != MAX_ATTRS * 2 + 2; i++)
free((*params)[i]);
free(*params);
}
free(type);
return 0;