Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: nss/lib/util/secitem.c

Issue 14704003: Fix a memory leak in SECITEM_FreeArray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.chromium ('k') | patches/nss-secitem-array-leak.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nss/lib/util/secitem.c
===================================================================
--- nss/lib/util/secitem.c (revision 197158)
+++ nss/lib/util/secitem.c (working copy)
@@ -360,7 +360,8 @@
return(NULL);
}
-void secitem_FreeArray(SECItemArray *array, PRBool zero_items, PRBool freeit)
+static void
+secitem_FreeArray(SECItemArray *array, PRBool zero_items, PRBool freeit)
{
unsigned int i;
@@ -378,6 +379,9 @@
}
}
}
+ PORT_Free(array->items);
+ array->items = NULL;
+ array->len = 0;
if (freeit)
PORT_Free(array);
« no previous file with comments | « README.chromium ('k') | patches/nss-secitem-array-leak.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698