Skip to content

Commit 8615575

Browse files
committed
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.
1 parent c773294 commit 8615575

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bindings/solv.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ typedef struct {
6363
$2 = size;
6464
}
6565

66-
%typemap(freearg,noblock=1,match="in") (const unsigned char *str, int len) {
66+
%typemap(freearg,noblock=1,match="in") (const unsigned char *str, size_t len) {
6767
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
6868
}
6969

0 commit comments

Comments
 (0)