瀏覽代碼

Bug 630092 - Coverity #12000: Resource leaks issues

https://bugzilla.redhat.com/show_bug.cgi?id=630092

Description:

The plugin_setup() has been modified to release the value before
it returns.
Endi Sukma Dewata 15 年之前
父節點
當前提交
16b151c38f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ldap/servers/slapd/plugin.c

+ 2 - 2
ldap/servers/slapd/plugin.c

@@ -2270,6 +2270,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
 				  plugin->plg_initfunc, plugin->plg_name,
 				  plugin->plg_libpath);
         status = -1;
+		slapi_ch_free((void**)&value);
 		goto PLUGIN_CLEANUP;
 	}
 
@@ -2277,8 +2278,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
 		status = plugin_add_descriptive_attributes( plugin_entry, plugin );
 	}
 
-	if (value)
-		slapi_ch_free((void**)&value);
+	slapi_ch_free((void**)&value);
 
 	if(enabled)
 	{