mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix two memory leaks.
This commit is contained in:
parent
2a6eb83fb4
commit
fd25a6425c
2 changed files with 6 additions and 0 deletions
|
@ -398,6 +398,9 @@ start_conversion:
|
||||||
{
|
{
|
||||||
debug(0, L"%d %d", in_len, out_len);
|
debug(0, L"%d %d", in_len, out_len);
|
||||||
debug(0, L"Error while converting from to string");
|
debug(0, L"Error while converting from to string");
|
||||||
|
|
||||||
|
/* Terminate the output string. */
|
||||||
|
free(out);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,10 @@ _xdg_mime_magic_parse_header(FILE *magic_file, XdgMimeMagicMatch *match)
|
||||||
|
|
||||||
buffer = _xdg_mime_magic_read_to_newline(magic_file, &end_of_file);
|
buffer = _xdg_mime_magic_read_to_newline(magic_file, &end_of_file);
|
||||||
if (end_of_file)
|
if (end_of_file)
|
||||||
|
{
|
||||||
|
free(buffer);
|
||||||
return XDG_MIME_MAGIC_EOF;
|
return XDG_MIME_MAGIC_EOF;
|
||||||
|
}
|
||||||
|
|
||||||
end_ptr = buffer;
|
end_ptr = buffer;
|
||||||
while (*end_ptr != ']' && *end_ptr != '\000' && *end_ptr != '\n')
|
while (*end_ptr != ']' && *end_ptr != '\000' && *end_ptr != '\n')
|
||||||
|
|
Loading…
Reference in a new issue