* [ SETSEBOOL ] Fix memory leak
@ 2005-11-05 5:29 Ivan Gyurdiev
0 siblings, 0 replies; only message in thread
From: Ivan Gyurdiev @ 2005-11-05 5:29 UTC (permalink / raw)
To: selinux; +Cc: Stephen Smalley
[-- Attachment #1: Type: text/plain, Size: 85 bytes --]
Fix memory leak which I introduced... I don't like introducing bugs of
any sort..
[-- Attachment #2: setsebool.fix_leak.diff --]
[-- Type: text/x-patch, Size: 647 bytes --]
diff -Naurp --exclude CVS --exclude ChangeLog --exclude VERSION --exclude Makefile old/policycoreutils/setsebool/setsebool.c new/policycoreutils/setsebool/setsebool.c
--- old/policycoreutils/setsebool/setsebool.c 2005-11-05 00:15:55.000000000 -0500
+++ new/policycoreutils/setsebool/setsebool.c 2005-11-05 00:23:34.000000000 -0500
@@ -220,13 +220,15 @@ int setbool(char **list, size_t start, s
i++;
}
+ for (i=0; i < boolcnt; i++)
+ free(vallist[i].name);
+ free(vallist);
return 0;
err:
for (i=0; i < boolcnt; i++)
- if (vallist[i].name) free(vallist[i].name);
+ free(vallist[i].name);
free(vallist);
-
return -1;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-05 5:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-05 5:29 [ SETSEBOOL ] Fix memory leak Ivan Gyurdiev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.