projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dc34de
)
Don't forget to free resources in an early return
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 14 Jun 2011 14:07:22 +0000
(10:07 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 14 Jun 2011 14:07:22 +0000
(10:07 -0400)
gio/xdgmime/xdgmimemagic.c
patch
|
blob
|
history
diff --git
a/gio/xdgmime/xdgmimemagic.c
b/gio/xdgmime/xdgmimemagic.c
index
ae1093a
..
63e0bdd
100644
(file)
--- a/
gio/xdgmime/xdgmimemagic.c
+++ b/
gio/xdgmime/xdgmimemagic.c
@@
-272,7
+272,10
@@
_xdg_mime_magic_parse_header (FILE *magic_file, XdgMimeMagicMatch *match)
buffer = (char *)_xdg_mime_magic_read_to_newline (magic_file, &end_of_file);
if (end_of_file)
- return XDG_MIME_MAGIC_EOF;
+ {
+ free (buffer);
+ return XDG_MIME_MAGIC_EOF;
+ }
end_ptr = buffer;
while (*end_ptr != ']' && *end_ptr != '\000' && *end_ptr != '\n')