Commit a38c79db66b3018da6f33acc49c6e25ccf86e38f

Martin Mitas 2016-12-15T11:29:31

md_build_attr_append_substr: Fix leak on an error path (CID 1389262).

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/md4c/md4c.c b/md4c/md4c.c
index fcb88a8..a7b0491 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1359,6 +1359,7 @@ md_build_attr_append_substr(MD_CTX* ctx, MD_ATTRIBUTE_BUILD* build,
                                     build->substr_alloc * sizeof(OFF));
         if(new_substr_offsets == NULL) {
             MD_LOG("realloc() failed.");
+            free(new_substr_types);
             return -1;
         }