Fix memory leak in destroy APIs 91/201591/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 18 Mar 2019 05:10:20 +0000 (14:10 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 18 Mar 2019 05:10:20 +0000 (14:10 +0900)
Change-Id: I36aacc0eed5ccc4e1014b671e9783027120accd7
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
client/autofill.c
common/autofill_item.c
manager/autofill_manager.c

index e8985d3aa1761108571023ef161855023a32bfa0..e1326632cb44e60d3fee0c93981ba230d72366a5 100644 (file)
@@ -315,6 +315,8 @@ EXPORT_API int autofill_destroy(autofill_h ah)
         ah->rpc_h = NULL;
     }
 
+    free(ah);
+
     return AUTOFILL_ERROR_NONE;
 }
 
@@ -466,4 +468,4 @@ EXPORT_API int autofill_error_info_unset_received_cb(autofill_h ah)
     ah->autofill_error_info_data = NULL;
 
     return AUTOFILL_ERROR_NONE;
-}
\ No newline at end of file
+}
index 8a20806f8501fda47f5d5f269779307d752e989d..f90b9ccb4a9556952aabdd0117cf44813f07ee3a 100644 (file)
@@ -51,7 +51,6 @@ EXPORT_API int autofill_item_create(autofill_item_h *it)
     return AUTOFILL_ERROR_NONE;
 }
 
-// Destroy autofill info list item
 EXPORT_API int autofill_item_destroy(autofill_item_h it)
 {
     if (!it)
index e2becfc2884f067b62bb4d3ade2b0612610ccedd..b452824a402d8bb3929c1be372dcae380263e763 100644 (file)
@@ -133,6 +133,8 @@ EXPORT_API int autofill_manager_destroy(autofill_manager_h amh)
         amh->rpc_h = NULL;
     }
 
+    free(amh);
+
     return AUTOFILL_ERROR_NONE;
 }