summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-11-11 16:44:07 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-12-18 11:15:58 +1100
commit218b5233de442ce67784f9f5e3cd43b2b3f3306b (patch)
treeda9c589cb56c6e16e6f92fabd8a32d3f8396837a /ui/common
parente90189081c52496a9db6fd0b8a0c4899f51b9049 (diff)
downloadpetitboot-218b5233de442ce67784f9f5e3cd43b2b3f3306b.zip
petitboot-218b5233de442ce67784f9f5e3cd43b2b3f3306b.tar.gz
ui/common: Free message on return
Fixes Coverity defect #30468 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/discover-client.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/common/discover-client.c b/ui/common/discover-client.c
index 14f36da..71ef70b 100644
--- a/ui/common/discover-client.c
+++ b/ui/common/discover-client.c
@@ -181,7 +181,7 @@ static int discover_client_process(void *arg)
rc = pb_protocol_deserialise_device(dev, message);
if (rc) {
pb_log("%s: no device?\n", __func__);
- return 0;
+ goto out;
}
device_add(client, dev);
@@ -192,7 +192,7 @@ static int discover_client_process(void *arg)
rc = pb_protocol_deserialise_boot_option(opt, message);
if (rc) {
pb_log("%s: no boot_option?\n", __func__);
- return 0;
+ goto out;
}
boot_option_add(client, opt);
@@ -201,7 +201,7 @@ static int discover_client_process(void *arg)
dev_id = pb_protocol_deserialise_string(ctx, message);
if (!dev_id) {
pb_log("%s: no device id?\n", __func__);
- return 0;
+ goto out;
}
device_remove(client, dev_id);
break;
@@ -211,7 +211,7 @@ static int discover_client_process(void *arg)
rc = pb_protocol_deserialise_boot_status(status, message);
if (rc) {
pb_log("%s: invalid status message?\n", __func__);
- return 0;
+ goto out;
}
update_status(client, status);
break;
@@ -221,7 +221,7 @@ static int discover_client_process(void *arg)
rc = pb_protocol_deserialise_system_info(sysinfo, message);
if (rc) {
pb_log("%s: invalid sysinfo message?\n", __func__);
- return 0;
+ goto out;
}
update_sysinfo(client, sysinfo);
break;
@@ -231,7 +231,7 @@ static int discover_client_process(void *arg)
rc = pb_protocol_deserialise_config(config, message);
if (rc) {
pb_log("%s: invalid config message?\n", __func__);
- return 0;
+ goto out;
}
update_config(client, config);
break;
@@ -239,6 +239,7 @@ static int discover_client_process(void *arg)
pb_log("%s: unknown action %d\n", __func__, message->action);
}
+out:
talloc_free(ctx);
return 0;
OpenPOWER on IntegriCloud