From: Jaroslav Rohel Date: Thu, 8 Apr 2021 10:17:09 +0000 (+0200) Subject: Fix: Memory leaks in SWIG generated code (for Python) X-Git-Tag: 0.7.20~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F445%2Fhead;p=thirdparty%2Flibsolv.git Fix: Memory leaks in SWIG generated code (for Python) 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. --- diff --git a/bindings/solv.i b/bindings/solv.i index 1882b135..3bbeca04 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -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); }