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

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