diff options
author | Djalal Harouni <tixxdz@opendz.org> | 2014-03-23 23:06:35 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2014-03-24 03:46:41 +0100 |
commit | 17fe99c53decad00b787154ef2de9749dbab0ba6 (patch) | |
tree | 4b8e7e43d588135863ea7b55780f32093b2d768f | |
parent | e0638b27495d2cc3c574c38975ffbcb958a9636e (diff) | |
download | kdbus-bus-17fe99c53decad00b787154ef2de9749dbab0ba6.tar.gz kdbus-bus-17fe99c53decad00b787154ef2de9749dbab0ba6.tar.bz2 kdbus-bus-17fe99c53decad00b787154ef2de9749dbab0ba6.zip |
endpoint: free the policy_db on error path
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
-rw-r--r-- | endpoint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/endpoint.c b/endpoint.c index 465ae31ec77..5afabf9d857 100644 --- a/endpoint.c +++ b/endpoint.c @@ -236,7 +236,7 @@ int kdbus_ep_new(struct kdbus_bus *bus, const char *name, if (bus->disconnected) { mutex_unlock(&bus->lock); ret = -ESHUTDOWN; - goto exit_dev_unregister; + goto exit_policy_db_free; } e->id = ++bus->ep_seq_last; e->bus = kdbus_bus_ref(bus); @@ -247,6 +247,9 @@ int kdbus_ep_new(struct kdbus_bus *bus, const char *name, *ep = e; return 0; +exit_policy_db_free: + if (policy) + kdbus_policy_db_free(e->policy_db); exit_dev_unregister: device_unregister(e->dev); exit_idr: |