gluon-airtime: Fix memory leak and uninitialized struct

This commit is contained in:
Jan-Philipp Litza 2016-12-08 20:00:37 +01:00
parent 4322d8323c
commit 5ba752f6b1
2 changed files with 2 additions and 4 deletions

View File

@ -53,8 +53,6 @@ struct iface_list *get_ifaces() {
#undef CHECK #undef CHECK
return ifaces;
out: out:
if (msg) if (msg)
nlmsg_free(msg); nlmsg_free(msg);
@ -62,5 +60,5 @@ out:
if (sk) if (sk)
nl_socket_free(sk); nl_socket_free(sk);
return NULL; return ifaces;
} }

View File

@ -24,7 +24,7 @@ void fill_airtime_json(struct airtime_result *air, struct json_object *wireless)
} }
static struct json_object *respondd_provider_statistics(void) { static struct json_object *respondd_provider_statistics(void) {
struct airtime_result airtime; struct airtime_result airtime = {};
struct json_object *result, *wireless; struct json_object *result, *wireless;
struct iface_list *ifaces; struct iface_list *ifaces;
void *freeptr; void *freeptr;