Bug 1216505 - [CID 1327945] leaked_storage: Variable label going out of scope leaks the storage it points to, r=mt
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Tue, 20 Oct 2015 14:40:40 +0200
changeset 11687 26b8dc7b51d36d9081b63f5dc3b0c8675e123d78
parent 11686 81a6719530de7827966c7b0426a251c902d7663b
child 11688 4398610ede4721150a9c4837857b33e7852691cb
push id828
push usermartin.thomson@gmail.com
push dateTue, 20 Oct 2015 16:49:24 +0000
reviewersmt
bugs1216505, 1327945
Bug 1216505 - [CID 1327945] leaked_storage: Variable label going out of scope leaks the storage it points to, r=mt
lib/softoken/legacydb/lgattr.c
--- a/lib/softoken/legacydb/lgattr.c
+++ b/lib/softoken/legacydb/lgattr.c
@@ -1771,13 +1771,14 @@ lg_SetAttributeValue(SDB *sdb, CK_OBJECT
 
 	if (privKey) {
 	    rv = nsslowkey_StoreKeyByPublicKeyAlg(lg_getKeyDB(sdb), privKey, 
 		&obj->dbKey, label, sdb, PR_TRUE );
 	}
 	if (rv != SECSuccess) {
 	    crv = CKR_DEVICE_ERROR;
 	}
+	PORT_Free(label);
     }
 
     lg_DestroyObjectCache(obj);
     return crvCollect;
 }