Hide Forgot
Version-Release number of selected component (if applicable): nss-3.12.10-17.1.el6 How reproducible: 100 % Steps to Reproduce: 1. patch curl by attachment #525555 [details] 2. run this test-case: attachment #551005 [details] Actual results: ==17888== 512 bytes in 16 blocks are definitely lost in loss record 75 of 86 ==17888== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==17888== by 0x331A412574: GrowStuff (prprf.c:1076) ==17888== by 0x331A411BD7: dosprintf (prprf.c:137) ==17888== by 0x331A412439: PR_vsmprintf (prprf.c:1127) ==17888== by 0x331A41272C: PR_smprintf (prprf.c:1105) ==17888== by 0x5581D5C: nss_MkConfigString (nssinit.c:205) ==17888== by 0x55826E9: nss_Init (nssinit.c:597) ==17888== by 0x5582DFA: NSS_InitContext (nssinit.c:804) ==17888== by 0x4EC8776: nss_init_core (nss.c:905) ==17888== by 0x4EC8914: nss_init (nss.c:949) ==17888== by 0x4EC8F7F: Curl_nss_connect (nss.c:1167) ==17888== by 0x4EBC00A: Curl_ssl_connect (sslgen.c:185)
Created attachment 551566 [details] a proposed fix
Thank you for the patch but is not needed since the update to nss 3.13.1. In the current code in nssinit.c we have loser: if (initContextPtr && *initContextPtr) { PORT_Free(*initContextPtr); *initContextPtr = NULL; if (configStrings) { PR_smprintf_free(configStrings); } } and with initContextPtr NULL configStrings = pk11_config_strings whose allocation/deallocation is handled by PK11_ConfigurePKCS11 and PK11_UnconfigurePKCS11.
(In reply to comment #3) > Thank you for the patch but is not needed since the update to nss 3.13.1. I disagree. > In the current code in nssinit.c we have > loser: > if (initContextPtr && *initContextPtr) { > PORT_Free(*initContextPtr); > *initContextPtr = NULL; > if (configStrings) { > PR_smprintf_free(configStrings); > } > } This code is not new to 3.13.1 and does not solve the issue I reported. > and with initContextPtr NULL configStrings = pk11_config_strings whose > allocation/deallocation is handled by PK11_ConfigurePKCS11 and > PK11_UnconfigurePKCS11. Right, then we need to handle this case separately to avoid a double free.
Created attachment 566601 [details] a proposed fix V2 Avoid a double free.
Is this NSS bug required for fixing bug 738456?
(In reply to comment #6) > Is this NSS bug required for fixing bug 738456? Without this patch applied, nss will start to leak on initialization as soon as bug 738456 is fixed. From my point of view, such amount of memory leakage is acceptable, but I am not the one here to make decisions.
upstream bug?
Elio, could you please apply my fix on Fedora? This bug breaks curl's test-suite badly: http://koji.fedoraproject.org/koji/getfile?taskID=3987501&name=build.log
(In reply to comment #13) Kamil, I applied your fix to Fedora Rawhide and submitted it upstream.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No documentation needed
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0973.html