discover: cleanup allocated data
[petitboot] / 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;
 }