mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 07:02:05 +08:00
Fix warning about realloc in xdgmimemagic
This commit is contained in:
parent
4416753df0
commit
547b0a9850
|
@ -183,7 +183,13 @@ _xdg_mime_magic_read_to_newline(FILE *magic_file,
|
|||
if (pos % 128 == 127)
|
||||
{
|
||||
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 New Issue
Block a user