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

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