Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77bf15a2 authored by Amir Samuelov's avatar Amir Samuelov Committed by Gerrit - the friendly Code Review server
Browse files

spcom: fix memory leak in spcom register client / register service API



free allocated memory in error handling of spcom_register_client()
and spcom_register_service() kernel API.

Change-Id: Ieb5787cb1a11d4b3320237fa8cdde3dc357d9084
Signed-off-by: default avatarAmir Samuelov <amirs@codeaurora.org>
parent 6b09a0c3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1139,6 +1139,7 @@ struct spcom_client *spcom_register_client(struct spcom_client_info *info)
	ch = spcom_find_channel_by_name(name);
	if (!ch) {
		pr_err("channel %s doesn't exist, load App first.\n", name);
		kfree(client);
		return NULL;
	}

@@ -1326,6 +1327,7 @@ struct spcom_server *spcom_register_service(struct spcom_service_info *info)
	ch = spcom_find_channel_by_name(name);
	if (!ch) {
		pr_err("channel %s doesn't exist, load App first.\n", name);
		kfree(server);
		return NULL;
	}