Fix bug: memory leak 97/122897/2 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170404.143021 accepted/tizen/ivi/20170404.062124 accepted/tizen/mobile/20170404.062039 accepted/tizen/tv/20170404.062053 accepted/tizen/unified/20170404.062143 accepted/tizen/wearable/20170404.062110 submit/tizen/20170404.041634
authorYunmi Ha <yunmi.ha@samsung.com>
Tue, 4 Apr 2017 01:27:24 +0000 (10:27 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Tue, 4 Apr 2017 02:21:26 +0000 (11:21 +0900)
Add memory free code for several leaked memory.

Change-Id: I733762a26c279e4bae07ab134a5980ac83b5e95c
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
src/common/tlm-utils.c

index cc04208..fcd6a60 100755 (executable)
@@ -604,7 +604,7 @@ typedef enum {
   WATCH_ADDED,
   WATCH_READY
 } AddWatchResults;
-  
+
 AddWatchResults
 _add_watch (int ifd, char *file_path, WatchInfo *info) {
   GList *file_list = NULL;
@@ -812,6 +812,7 @@ tlm_utils_watch_for_files (
     } else {
       nwatch++;
     }
+    g_free(socket_path);
   }
 
   if (nwatch == 0) {
@@ -905,6 +906,9 @@ tlm_authenticate_user (
     ret = pam_start (service, username, &conv, &pam_h);
     if (ret != PAM_SUCCESS) {
         WARN("Failed to pam_start: %d", ret);
+        free(info->username);
+        free(info->password);
+        g_free(info);
         return FALSE;
     }