Fix warning about realloc in xdgmimemagic

This commit is contained in:
ridiculousfish 2013-02-16 13:17:43 -08:00
parent 4416753df0
commit 547b0a9850

View file

@ -183,7 +183,13 @@ _xdg_mime_magic_read_to_newline(FILE *magic_file,
if (pos % 128 == 127) if (pos % 128 == 127)
{ {
len = len + 128; len = len + 128;
retval = (char *)realloc(retval, len); char *tmp = (char *)realloc(retval, len);
if (tmp == NULL)
{
free(retval);
return NULL;
}
retval = tmp;
} }
} }