File avoid_doublefree_in_sunsetcontrol.patch of Package sblim-sfcb
Index: sblim-sfcb-1.4.8/control.c
===================================================================
--- sblim-sfcb-1.4.8.orig/control.c
+++ sblim-sfcb-1.4.8/control.c
@@ -216,6 +216,9 @@ sunsetControl()
{
int i,
m;
+ if (!cache)
+ return;
+
for (i = 0, m = sizeof(init) / sizeof(Control); i < m; i++) {
if(cache[i].dupped) {
free(cache[i].strValue);
@@ -226,8 +229,8 @@ sunsetControl()
ct->ft->release(ct);
ct=NULL;
}
- if (cache)
- free(cache);
+ free(cache);
+ cache = NULL;
}
static int