Initialize NULL after dealloc memory 72/192372/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 5 Nov 2018 00:45:15 +0000 (09:45 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 5 Nov 2018 00:45:15 +0000 (09:45 +0900)
Change-Id: I57ecd4257469fe321b1cd3e14d441c683ebfe086
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
common/autofill_auth_info.c
common/autofill_fill_response.c
common/autofill_fill_response_item.c [changed mode: 0755->0644]
common/autofill_item.c
common/autofill_save_item.c [changed mode: 0755->0644]
common/autofill_save_view_info.c [changed mode: 0755->0644]
common/autofill_view_info.c [changed mode: 0755->0644]
include/autofill_common.h [changed mode: 0755->0644]
include/autofill_service.h [changed mode: 0755->0644]

index 80ae5eb..ccb8cc1 100644 (file)
@@ -58,17 +58,25 @@ EXPORT_API int autofill_auth_info_destroy(autofill_auth_info_h ai)
     if (!ai)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (ai->app_id)
+    if (ai->app_id) {
         free(ai->app_id);
+        ai->app_id = NULL;
+    }
 
-    if (ai->service_name)
+    if (ai->service_name) {
         free(ai->service_name);
+        ai->service_name = NULL;
+    }
 
-    if (ai->service_message)
+    if (ai->service_message) {
         free(ai->service_message);
+        ai->service_message = NULL;
+    }
 
-    if (ai->service_logo_image_path)
+    if (ai->service_logo_image_path) {
         free(ai->service_logo_image_path);
+        ai->service_logo_image_path = NULL;
+    }
 
     free(ai);
 
index ba2e626..8116897 100644 (file)
@@ -46,8 +46,10 @@ EXPORT_API int autofill_fill_response_destroy(autofill_fill_response_h h)
     if (!h)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (h->view_id)
+    if (h->view_id) {
         free(h->view_id);
+        h->view_id = NULL;
+    }
 
     // Release memory autofill fill response item list
     autofill_fill_response_group_h it_h;
old mode 100755 (executable)
new mode 100644 (file)
index 604717a..52d8af8
@@ -52,14 +52,20 @@ EXPORT_API int autofill_fill_response_item_destroy(autofill_fill_response_item_h
     if (!it)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (it->id)
+    if (it->id) {
         free(it->id);
+        it->id = NULL;
+    }
 
-    if (it->value)
+    if (it->value) {
         free(it->value);
+        it->value = NULL;
+    }
 
-    if (it->presentation_text)
+    if (it->presentation_text) {
         free(it->presentation_text);
+        it->presentation_text = NULL;
+    }
 
     free(it);
 
index e43c3ae..450443a 100644 (file)
@@ -57,14 +57,20 @@ EXPORT_API int autofill_item_destroy(autofill_item_h it)
     if (!it)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (it->id)
+    if (it->id) {
         free(it->id);
+        it->id = NULL;
+    }
 
-    if (it->label)
+    if (it->label) {
         free(it->label);
+        it->label = NULL;
+    }
 
-    if (it->value)
+    if (it->value) {
         free(it->value);
+        it->value = NULL;
+    }
 
     free(it);
 
old mode 100755 (executable)
new mode 100644 (file)
index 381421a..a0404d3
@@ -56,14 +56,20 @@ EXPORT_API int autofill_save_item_destroy(autofill_save_item_h it)
     if (!it)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (it->id)
+    if (it->id) {
         free(it->id);
+        it->id = NULL;
+    }
 
-    if (it->label)
+    if (it->label) {
         free(it->label);
+        it->label = NULL;
+    }
 
-    if (it->value)
+    if (it->value) {
         free(it->value);
+        it->value = NULL;
+    }
 
     free(it);
 
old mode 100755 (executable)
new mode 100644 (file)
index 4be0ff9..90c92cb
@@ -47,11 +47,15 @@ EXPORT_API int autofill_save_view_info_destroy(autofill_save_view_info_h vi)
     if (!vi)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (vi->app_id)
+    if (vi->app_id) {
         free(vi->app_id);
+        vi->app_id = NULL;
+    }
 
-    if (vi->view_id)
+    if (vi->view_id) {
         free(vi->view_id);
+        vi->view_id = NULL;
+    }
 
     // release memory autofill item list
     autofill_save_item_h it_h;
old mode 100755 (executable)
new mode 100644 (file)
index cbb1e55..864d5b6
@@ -46,11 +46,15 @@ EXPORT_API int autofill_view_info_destroy(autofill_view_info_h vi)
     if (!vi)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
-    if (vi->app_id)
+    if (vi->app_id) {
         free(vi->app_id);
+        vi->app_id = NULL;
+    }
 
-    if (vi->view_id)
+    if (vi->view_id) {
         free(vi->view_id);
+        vi->view_id = NULL;
+    }
 
     // release memory autofill item list
     autofill_item_h it_h;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)