From: Djalal Harouni Date: Sun, 23 Mar 2014 23:20:36 +0000 (+0100) Subject: handle: unref handle->ep and free handle->meta on error path X-Git-Tag: upstream/0.20140325.112233cet~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eeaff62de6fd6362e8c8de05c5ea94ee562daf8b;p=platform%2Fcore%2Fsystem%2Fkdbus-bus.git handle: unref handle->ep and free handle->meta on error path Signed-off-by: Djalal Harouni --- diff --git a/handle.c b/handle.c index 921faca..3af6119 100644 --- a/handle.c +++ b/handle.c @@ -130,7 +130,7 @@ static int kdbus_handle_open(struct inode *inode, struct file *file) /* cache the metadata/credentials of the creator of the connection */ ret = kdbus_meta_new(&handle->meta); if (ret < 0) - goto exit_unlock; + goto exit_ep_unref; ret = kdbus_meta_append(handle->meta, NULL, 0, KDBUS_ATTACH_CREDS | @@ -142,11 +142,15 @@ static int kdbus_handle_open(struct inode *inode, struct file *file) KDBUS_ATTACH_SECLABEL | KDBUS_ATTACH_AUDIT); if (ret < 0) - goto exit_unlock; + goto exit_meta_free; mutex_unlock(&handle->domain->lock); return 0; +exit_meta_free: + kdbus_meta_free(handle->meta); +exit_ep_unref: + kdbus_ep_unref(handle->ep); exit_unlock: mutex_unlock(&handle->domain->lock); kdbus_domain_unref(handle->domain);