]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in unittest helper function.
authorNick Mathewson <nickm@torproject.org>
Sat, 26 Apr 2014 04:13:49 +0000 (00:13 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 26 Apr 2014 04:13:49 +0000 (00:13 -0400)
src/test/test_util.c

index 256d8499191a8a40b4490c51e252dd551f60a6d5..f2a0eafb3c2746175266b240cc265586733d16a6 100644 (file)
@@ -3146,6 +3146,8 @@ smartlist_new_from_text_lines(const char *lines)
   last_line = smartlist_pop_last(sl);
   if (last_line != NULL && *last_line != '\0') {
     smartlist_add(sl, last_line);
+  } else {
+    tor_free(last_line);
   }
 
   return sl;