]> granicus.if.org Git - transmission/commitdiff
Fix small memory leaks in crypto (base64) and rename (multi-file torrent) unit tests
authorMike Gelfand <mikedld@mikedld.com>
Sun, 7 Dec 2014 10:42:12 +0000 (10:42 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sun, 7 Dec 2014 10:42:12 +0000 (10:42 +0000)
libtransmission/crypto-test.c
libtransmission/rename-test.c

index 26b06867f9e2e54c2c173292984b22e1103c9cc3..6474907cfc37122bd4faed982f33c0a6fffe53f0 100644 (file)
@@ -202,16 +202,20 @@ test_base64 (void)
   out = tr_base64_encode ("", 0, &len);
   check_int_eq (0, len);
   check_streq ("", out);
+  tr_free (out);
   out = tr_base64_decode ("", 0, &len);
   check_int_eq (0, len);
   check_streq ("", out);
+  tr_free (out);
 
   out = tr_base64_encode (NULL, 0, &len);
   check_int_eq (0, len);
   check (out == NULL);
+  tr_free (out);
   out = tr_base64_decode (NULL, 0, &len);
   check_int_eq (0, len);
   check (out == NULL);
+  tr_free (out);
 
 #define MAX_BUF_SIZE 1024
 
index aad099689f2948e6e5976ac527437d1eba5ccbf6..bc094428b66086f84d801e7760787cb705004b87 100644 (file)
@@ -441,6 +441,7 @@ test_multifile_torrent (void)
   ***  Test renaming prefixes (shouldn't work)
   **/
 
+  tr_ctorFree (ctor);
   tr_torrentRemove (tor, false, NULL);
   do {
     tr_wait_msec (10);