discover: cleanup allocated data
authorJeremy Kerr <jk@ozlabs.org>
Fri, 18 Oct 2013 05:26:23 +0000 (13:26 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 21 Oct 2013 11:30:08 +0000 (19:30 +0800)
We have a few allocations hanging around at the end of pb-discover; free
them.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/pb-discover.c

index 9b1f20041da7a7a764233abc4f1d3499775be2a1..b15413090e49fefc34b84ef0f7f0385328994ad5 100644 (file)
@@ -13,6 +13,7 @@
 #include <log/log.h>
 #include <pb-config/pb-config.h>
 #include <process/process.h>
+#include <talloc/talloc.h>
 
 #include "udev.h"
 #include "user-event.h"
@@ -200,10 +201,16 @@ int main(int argc, char *argv[])
        }
 
        device_handler_destroy(handler);
+       user_event_destroy(uev);
        udev_destroy(udev);
+       discover_server_destroy(server);
        config_fini();
+       talloc_free(waitset);
 
        pb_log("--- end ---\n");
 
+       if (log != stderr)
+               fclose(log);
+
        return EXIT_SUCCESS;
 }