Browse Source

Bug 697027 - 16 - minor memory leaks found by Valgrind + TET

https://bugzilla.redhat.com/show_bug.cgi?id=697027
[Case 16]
Description: Adding slapi_ch_free_string to free pb_instance_name
allocated in the restore task.
Noriko Hosoi 14 years ago
parent
commit
2b263e8fa3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      ldap/servers/slapd/task.c

+ 2 - 0
ldap/servers/slapd/task.c

@@ -1434,6 +1434,7 @@ static void task_restore_thread(void *arg)
 
     slapi_task_finish(task, rv);
     slapi_ch_free((void **)&pb->pb_seq_val);
+    slapi_ch_free_string(&pb->pb_instance_name);
     slapi_pblock_destroy(pb);
     g_decr_active_threadcnt();
 }
@@ -1535,6 +1536,7 @@ static int task_restore_add(Slapi_PBlock *pb, Slapi_Entry *e,
         *returncode = LDAP_OPERATIONS_ERROR;
         rv = SLAPI_DSE_CALLBACK_ERROR;
         slapi_ch_free((void **)&mypb->pb_seq_val);
+        slapi_ch_free_string(&pb->pb_instance_name);
         slapi_pblock_destroy(mypb);
         goto out;
     }