Fix leaks on discovery test
authorCloudef <mailRoxas@gmail.com>
Tue, 30 Aug 2011 13:12:15 +0000 (16:12 +0300)
committerskeezix <skeezix@fw.skeleton.org>
Fri, 2 Sep 2011 13:20:25 +0000 (09:20 -0400)
test/discotest.c

index f6584b0..580d3d4 100644 (file)
@@ -184,11 +184,17 @@ int main ( int argc, char *argv[] ) {
        }
       }
 
+      // free current disco <o/
+      pnd_disco_destroy( d );
+
       // next!
       d = pnd_box_get_next ( d );
 
     } // while applist
 
+    // delete our search
+    pnd_box_delete( applist );
+
   } else {
     printf ( "No applications found in search path\n" );
   }
@@ -242,7 +248,8 @@ int main ( int argc, char *argv[] ) {
   printf ( "Unrelated test..\n" );
   char *p = strdup ( "~/.applications" );
   printf ( "Tilde substitution: in '%s'\n", p );
-  printf ( "                   out '%s'\n", pnd_expand_tilde ( p ) );
+  char *expand = pnd_expand_tilde ( p );
+  printf ( "                   out '%s'\n", expand ); free(expand);
 
   return ( 0 );
 }