Bug 585842: CERT_MakeCANickname should return NULL instead a static NSS_3_12_BRANCH
authorwtc%google.com
Thu, 02 Sep 2010 00:52:02 +0000
branchNSS_3_12_BRANCH
changeset 9803 e80961719331bad2c569ae7166772ca69faf09a7
parent 9802 8a189599759b9a57089546814226c0543d2088f5
child 9805 fb18545e94eb6ae9c49e1b62a90e465f3b85d0ea
push idunknown
push userunknown
push dateunknown
bugs585842
Bug 585842: CERT_MakeCANickname should return NULL instead a static empty string in error case, so that the return value can be safely freed with PORT_Free. The patch is contributed by Matt Mueller of Google <mattm@chromium.org>. r=wtc. Tag: NSS_3_12_BRANCH
security/nss/lib/certdb/certdb.c
--- a/security/nss/lib/certdb/certdb.c
+++ b/security/nss/lib/certdb/certdb.c
@@ -2124,17 +2124,17 @@ CERT_MakeCANickname(CERTCertificate *cer
 	    count++;
 	}
     }
 loser:
     if ( nickname ) {
 	PORT_Free(nickname);
     }
 
-    nickname = "";
+    nickname = NULL;
     
 done:
     if ( firstname ) {
 	PORT_Free(firstname);
     }
     if ( org ) {
 	PORT_Free(org);
     }