Browse Source

Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053

https://bugzilla.redhat.com/show_bug.cgi?id=619122
Resolves: bug 619122
Bug description: fix coverify Defect Type: Resource leaks issues CID 11982.
description: The check_trivial_words() has been modified to check for NULL smods first before allocating smod to avoid resource leak.
Endi S. Dewata 15 years ago
parent
commit
1e345f841a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/slapd/pw.c

+ 1 - 1
ldap/servers/slapd/pw.c

@@ -1401,7 +1401,7 @@ check_trivial_words (Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Value **vals, char
 	}
 
 	/* Get a list of new values for attrtype from the operation */
-	if ( (smod = slapi_mod_new()) && smods )
+	if ( smods && (smod = slapi_mod_new()) )
 	{
 		for (smodp = slapi_mods_get_first_smod(smods, smod);
 			smodp != NULL; smodp = slapi_mods_get_next_smod(smods, smod) )