From 08745d0bfe640dfeb2e5ea8061fb1a75fadb5f63 Mon Sep 17 00:00:00 2001 From: youngsub ko Date: Mon, 13 May 2013 20:18:21 +0900 Subject: [PATCH] Fixed memory leaks --- packaging/notification.spec | 2 +- src/notification_ipc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packaging/notification.spec b/packaging/notification.spec index c57faef..c58d6ee 100755 --- a/packaging/notification.spec +++ b/packaging/notification.spec @@ -1,6 +1,6 @@ Name: notification Summary: notification library -Version: 0.2.2 +Version: 0.2.3 Release: 1 Group: TBD License: Apache-2.0 diff --git a/src/notification_ipc.c b/src/notification_ipc.c index 069e39e..0d5db8a 100755 --- a/src/notification_ipc.c +++ b/src/notification_ipc.c @@ -950,8 +950,10 @@ notification_error_e notification_ipc_request_insert(notification_h noti, int *p } if (status != NOTIFICATION_ERROR_NONE) { + packet_unref(result); return status; } + packet_unref(result); } else { notification_ipc_is_master_ready(); return NOTIFICATION_ERROR_SERVICE_NOT_READY; @@ -983,6 +985,7 @@ notification_error_e notification_ipc_request_delete_single(notification_type_e packet_unref(result); return NOTIFICATION_ERROR_IO; } + packet_unref(result); } else { notification_ipc_is_master_ready(); return NOTIFICATION_ERROR_SERVICE_NOT_READY; @@ -1011,6 +1014,7 @@ notification_error_e notification_ipc_request_delete_multiple(notification_type_ return NOTIFICATION_ERROR_IO; } NOTIFICATION_ERR("num deleted:%d", num_deleted); + packet_unref(result); } else { notification_ipc_is_master_ready(); return NOTIFICATION_ERROR_SERVICE_NOT_READY; @@ -1038,6 +1042,7 @@ notification_error_e notification_ipc_request_update(notification_h noti) packet_unref(result); return NOTIFICATION_ERROR_IO; } + packet_unref(result); } else { notification_ipc_is_master_ready(); return NOTIFICATION_ERROR_SERVICE_NOT_READY; @@ -1064,6 +1069,7 @@ notification_error_e notification_ipc_request_refresh(void) packet_unref(result); return NOTIFICATION_ERROR_IO; } + packet_unref(result); } else { notification_ipc_is_master_ready(); return NOTIFICATION_ERROR_SERVICE_NOT_READY; -- 2.7.4