mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Fix warning about realloc in xdgmimemagic
This commit is contained in:
parent
4416753df0
commit
547b0a9850
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue