Blame SOURCES/0002-Fix-Memory-leaks-in-SWIG-generated-code-for-Python.patch

3a058d
From 8615575144e6fd3d708a30983ed2415db479ef4c Mon Sep 17 00:00:00 2001
3a058d
From: Jaroslav Rohel <jrohel@redhat.com>
3a058d
Date: Thu, 8 Apr 2021 12:17:09 +0200
3a058d
Subject: [PATCH] Fix: Memory leaks in SWIG generated code (for Python)
3a058d
3a058d
There were memory leaks in the `Chksum_from_bin`, `Chksum_add`,
3a058d
`SolvFp_write` functions wrapper for Python.
3a058d
3a058d
The problem was in "freearg" typemap argument defined in "solv.i".
3a058d
Therefore, the typemap was not applied.
3a058d
---
3a058d
 bindings/solv.i | 2 +-
3a058d
 1 file changed, 1 insertion(+), 1 deletion(-)
3a058d
3a058d
diff --git a/bindings/solv.i b/bindings/solv.i
3a058d
index 1882b13..3bbeca0 100644
3a058d
--- a/bindings/solv.i
3a058d
+++ b/bindings/solv.i
3a058d
@@ -63,7 +63,7 @@ typedef struct {
3a058d
   $2 = size;
3a058d
 }
3a058d
 
3a058d
-%typemap(freearg,noblock=1,match="in") (const unsigned char *str, int len) {
3a058d
+%typemap(freearg,noblock=1,match="in") (const unsigned char *str, size_t len) {
3a058d
   if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
3a058d
 }
3a058d
 
3a058d
--
3a058d
libgit2 1.0.1
3a058d