]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix: Memory leaks in SWIG generated code (for Python)
authorJaroslav Rohel <jrohel@redhat.com>
Thu, 8 Apr 2021 10:17:09 +0000 (12:17 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 4 Mar 2022 10:41:57 +0000 (11:41 +0100)
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 8fb469f0200a81c89fa8b43492be85b41fdc823a..a53610f7bdb739cb1806a1a73cd75cca8daa9ce7 100644 (file)
@@ -59,7 +59,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);
 }