utils/ubus: fix memory leak at blobmsg_format_json

This commit is contained in:
twy_2000 2020-05-30 23:31:02 +08:00 committed by Polynomialdivision
parent f603dde7f7
commit b5043ad98e

View file

@ -1061,11 +1061,13 @@ static void ubus_get_clients_cb(struct ubus_request *req, int type, struct blob_
if (entry == NULL) {
fprintf(stderr, "Failed to find interface!\n");
free(data_str);
return;
}
if (!entry->subscribed) {
fprintf(stderr, "Interface %s is not subscribed!\n", entry->iface_name);
free(data_str);
return;
}