[git] GPGME - branch, master, updated. gpgme-1.6.0-161-gf8f9bf0

by Justus Winter cvs at cvs.gnupg.org
Tue Jun 7 19:38:14 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  f8f9bf06bc3190968ba6613032d60a3bf2c8a6d9 (commit)
      from  8196edf9ca5c8f2f02553e7f22d9c79dbd229882 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f8f9bf06bc3190968ba6613032d60a3bf2c8a6d9
Author: Justus Winter <justus at g10code.com>
Date:   Tue Jun 7 16:07:33 2016 +0200

    python: Fix error handling.
    
    * lang/python/gpgme.i: Fix freeing an uninitialized pointer in the
    error handling of generated wrapper functions by explicitly storing
    the pointer in a local variable which can be initialized.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i
index e369582..f466a87 100644
--- a/lang/python/gpgme.i
+++ b/lang/python/gpgme.i
@@ -1,4 +1,5 @@
 /*
+# Copyright (C) 2016 g10 Code GmbH
 # Copyright (C) 2004,2008 Igor Belyi <belyi at users.sourceforge.net>
 # Copyright (C) 2002 John Goerzen <jgoerzen at complete.org>
 #
@@ -42,11 +43,11 @@
 %typemap(freearg) const char * "";
 
 /* Likewise for a list of strings.  */
-%typemap(in) const char *[] {
+%typemap(in) const char *[] (void *vector = NULL) {
   /* Check if is a list */
   if (PyList_Check($input)) {
     size_t i, size = PyList_Size($input);
-    $1 = (char **) malloc((size+1) * sizeof(char *));
+    $1 = (char **) (vector = malloc((size+1) * sizeof(char *)));
 
     for (i = 0; i < size; i++) {
       PyObject *o = PyList_GetItem($input,i);
@@ -72,7 +73,7 @@
   }
 }
 %typemap(freearg) const char *[] {
-  free((char *) $1);
+  free(vector$argnum);
 }
 
 // Release returned buffers as necessary.

-----------------------------------------------------------------------

Summary of changes:
 lang/python/gpgme.i | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list