This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=38cb8160e8d44a15d1397176489915b3057fbb66

commit 38cb8160e8d44a15d1397176489915b3057fbb66
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Aug 18 01:27:39 2020 +0200

    libdpkg: Fix short-lived memory leaks
    
    These strings are going to be auto-released on program exit.
    
    Warned-by: gcc ASAN
---
 lib/dpkg/ehandle.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 5bc459a0c..bfa220908 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -279,6 +279,7 @@ run_cleanups(struct error_context *econ, int flagsetin)
       if (cep->calls[i].call && cep->calls[i].mask & flagset) {
         if (setjmp(recurse_jump)) {
           run_cleanups(&recurserr, ehflag_bombout | ehflag_recursiveerror);
+          error_context_errmsg_free(&recurserr);
         } else {
           memset(&recurserr, 0, sizeof(recurserr));
           set_error_printer(&recurserr, print_cleanup_error, NULL);
@@ -428,6 +429,7 @@ run_error_handler(void)
      * abort. Hopefully the user can fix the situation (out of disk, out
      * of memory, etc). */
     print_abort_error(_("unrecoverable fatal error, aborting"), 
econtext->errmsg);
+    error_context_errmsg_free(econtext);
     exit(2);
   }
 
@@ -502,5 +504,7 @@ do_internerr(const char *file, int line, const char *func, 
const char *fmt, ...)
           color_get(COLOR_ERROR), _("internal error"), color_reset(),
           econtext->errmsg);
 
+  error_context_errmsg_free(econtext);
+
   abort();
 }

-- 
Dpkg.Org's dpkg

Reply via email to