[glib] Don't forget to free resources in an early return
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Don't forget to free resources in an early return
- Date: Tue, 14 Jun 2011 15:41:50 +0000 (UTC)
commit 83d34f630939aa13539e03895bef87da738c4127
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 14 10:07:22 2011 -0400
Don't forget to free resources in an early return
gio/xdgmime/xdgmimemagic.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/xdgmime/xdgmimemagic.c b/gio/xdgmime/xdgmimemagic.c
index ae1093a..63e0bdd 100644
--- 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')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]