]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix: Memory leaks in SWIG generated code (for Python) 445/head
authorJaroslav Rohel <jrohel@redhat.com>
Thu, 8 Apr 2021 10:17:09 +0000 (12:17 +0200)
committerJaroslav Rohel <jrohel@redhat.com>
Thu, 8 Apr 2021 10:46:33 +0000 (12:46 +0200)
There were memory leaks in the `Chksum_from_bin`, `Chksum_add`,
`SolvFp_write` functions wrapper for Python.

The problem was in "freearg" typemap argument defined in "solv.i".
Therefore, the typemap was not applied.

bindings/solv.i

index 1882b1359150c712b4dc07cb50b400fff3fd3b70..3bbeca04b2f6c8ec8db8325427da2f649e2af1a2 100644 (file)
@@ -63,7 +63,7 @@ typedef struct {
   $2 = size;
 }
 
-%typemap(freearg,noblock=1,match="in") (const unsigned char *str, int len) {
+%typemap(freearg,noblock=1,match="in") (const unsigned char *str, size_t len) {
   if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
 }