Ver código fonte

Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093

https://bugzilla.redhat.com/show_bug.cgi?id=617630
Resolves: bug 617630
Bug description: fix coverify Defect Type: Resource leaks issues CID 12061
description: des_cmp() has been modified to release resources before returning.
Endi S. Dewata 15 anos atrás
pai
commit
7aa393f723
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      ldap/servers/plugins/rever/rever.c

+ 6 - 2
ldap/servers/plugins/rever/rever.c

@@ -54,11 +54,15 @@ int
 des_cmp( char *userpwd, char *dbpwd )
 {
 	char *cipher = NULL;
+	int rc = 0;
 
 	if ( encode(userpwd, &cipher) != 0 )
-		return 1;
+		rc = 1;
 	else
-		return( strcmp(cipher, dbpwd) );
+		rc = strcmp(cipher, dbpwd);
+
+	slapi_ch_free((void**)&cipher);
+	return rc;
 }
 
 char *