From 0a55b1d53905c452b6e48bab0d0aaf50c4bba1a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Mon, 30 Jun 2014 01:56:20 +0200 Subject: [PATCH] Fix memory leaks in autodetect_file_type() and read_date() --- libhpcs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libhpcs.c b/libhpcs.c index 880f4eb..68efb8c 100644 --- a/libhpcs.c +++ b/libhpcs.c @@ -198,6 +198,7 @@ static enum HPCS_ParseCode autodetect_file_type(FILE* datafile, enum HPCS_File_T else *file_type = HPCS_TYPE_UNKNOWN; + free(type_str); free(type_id); return PARSE_OK; } @@ -330,6 +331,7 @@ static enum HPCS_ParseCode read_date(FILE* datafile, struct HPCS_Date* date) /* Get second */ date->second = strtoul(ms_delim + 1, NULL, 10); + free(date_str); return PARSE_OK; } -- 2.43.5