Hide Forgot
+++ This bug was initially created as a clone of Bug #734760 +++ Version-Release number of selected component (if applicable): nss-3.12.11-1.fc17 Additional info: Same bug in RHEL-6 and stable Fedora. --- Additional comment from kdudka on 2011-08-31 13:23:59 CEST --- Created attachment 520796 [details] proposed fix
This is currently worked around in upstream curl: https://github.com/bagder/curl/blob/491c5a4/lib/nss.c#L382 If you comment out the 'if(is_file(filename))' line, it will leak given a non-existing file name, and it will be easily visible in valgrind. IIRC, this bug broke curl test-suite, which runs through valgrind and this way I discovered the bug and came with the workaround.
Created attachment 569516 [details] Plug memory leak on pem_CreateObject
Comment on attachment 569516 [details] Plug memory leak on pem_CreateObject r+ rrelyea I still think there is a memory leak here, though. listItem, and listObj are not being freed in the error case.. in loser. This patch closes some of the leaks.
Comment on attachment 569516 [details] Plug memory leak on pem_CreateObject r-. Actually we should make sure we are freeing everything in this patch before it's approved.
Bob, you are right. The patch is incomplete.
Created attachment 569656 [details] proposed fix V2 $ valgrind /usr/bin/curl --cacert xxx https://localhost ==21816== Memcheck, a memory error detector ==21816== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==21816== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==21816== Command: /usr/bin/curl --cacert xxx https://localhost ==21816== curl: (77) Problem with the SSL CA cert (path? access rights?) ==21816== ==21816== HEAP SUMMARY: ==21816== in use at exit: 16,315 bytes in 101 blocks ==21816== total heap usage: 8,587 allocs, 8,486 frees, 2,269,057 bytes allocated ==21816== ==21816== LEAK SUMMARY: ==21816== definitely lost: 0 bytes in 0 blocks ==21816== indirectly lost: 0 bytes in 0 blocks ==21816== possibly lost: 88 bytes in 2 blocks ==21816== still reachable: 16,227 bytes in 99 blocks ==21816== suppressed: 0 bytes in 0 blocks ==21816== Rerun with --leak-check=full to see details of leaked memory ==21816== ==21816== For counts of detected and suppressed errors, rerun with: -v ==21816== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 9 from 7)
Comment on attachment 569656 [details] proposed fix V2 r+ Yup, that fixes it. bob
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