summaryrefslogtreecommitdiff
path: root/src/block-parser.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-20 12:39:45 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-20 12:39:45 +0200
commit6a65e34e42cb584d470f84a7b3760f289d11c0a2 (patch)
treed2718c7f46083a5ce0b4a8fc5d68052dbd830b00 /src/block-parser.c
parentd22dae58ba7e18ffdcac5f13ab9675eb1776c692 (diff)
downloadcataract-6a65e34e42cb584d470f84a7b3760f289d11c0a2.tar.xz
Plug some memory leaks
Diffstat (limited to 'src/block-parser.c')
-rw-r--r--src/block-parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/block-parser.c b/src/block-parser.c
index 9166e0c..688776f 100644
--- a/src/block-parser.c
+++ b/src/block-parser.c
@@ -202,9 +202,11 @@ block_parser_read_and_parse (BlockParser *parser, FILE *stream)
g_return_val_if_fail (parser != NULL, NULL);
buffer = g_malloc0 (BUFFER_SIZE);
- parser->current_line = g_strdup ("");
- if (! fgets (buffer, BUFFER_SIZE, stream) || strlen (buffer) == 0)
+ if (! fgets (buffer, BUFFER_SIZE, stream) || strlen (buffer) == 0) {
+ g_free (buffer);
return NULL;
+ }
+ parser->current_line = g_strdup ("");
keys = g_hash_table_get_keys (parser->table);