summaryrefslogtreecommitdiff
path: root/src/block-parser.c
diff options
context:
space:
mode:
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);