]> Devoid-pointer.net GitWeb - libHPCS.git/commitdiff
Fix memory leaks in autodetect_file_type() and read_date()
authorMichal Malý <madcatxster@devoid-pointer.net>
Sun, 29 Jun 2014 23:56:20 +0000 (01:56 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sun, 29 Jun 2014 23:56:20 +0000 (01:56 +0200)
libhpcs.c

index 880f4ebfc4b468842eef3b33a1f8f0c70b98c167..68efb8cc999c4506cd7edc25af09f9cf329e9577 100644 (file)
--- 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;
 }