Skip to content

Commit 6d5d21c

Browse files
committed
Fixed SWIG code in typemaps that was not freeing memory.
1 parent 9895db2 commit 6d5d21c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

swig/src/openscap.i

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
}
8888
$1[i] = 0;
8989
} else {
90+
free($1);
9091
PyErr_SetString(PyExc_TypeError,"not a list");
9192
return NULL;
9293
}
@@ -160,6 +161,9 @@
160161
$1[i] = (struct oval_syschar_model *) arg;
161162
}
162163
}
164+
%typemap(freearg) struct oval_syschar_model ** {
165+
free($1);
166+
}
163167
#elif defined(SWIGPERL)
164168
/* Definitions for PERL */
165169
#endif

0 commit comments

Comments
 (0)