diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-12-11 00:53:31 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-11 03:13:30 +0100 |
commit | 511f8b8885241d026fb4656943424b91f04a7ddf (patch) | |
tree | 53c7239c436ba9c187792187b2b21acf72c989c3 /file.c | |
parent | ef3a51f6eeb6346e2b234af5a091e42238c46c62 (diff) | |
download | subsurface-511f8b8885241d026fb4656943424b91f04a7ddf.tar.gz |
Plug potential memory leak in try_to_xslt_open_csv
Free temp buffer if realloc fails.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -122,8 +122,10 @@ static int try_to_xslt_open_csv(const char *filename, struct memblock *mem, char memcpy(mem->buffer + mem->size + 5, "</csv>", 7); mem->buffer = buf; mem->size += strlen("<csv></csv>"); - } else + } else { + free(mem->buffer); return 1; + } return 0; } |