summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-04-30 17:51:36 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-06-03 13:25:59 +0200
commitd37429aa532943fdb6ce6568b3d3176013a6b378 (patch)
tree0daed56a17d132287f3cf9888e480217d08c8411
parent5467d5e2bdd314ee62fc747f2f33ba58749bcc29 (diff)
downloadsssd-d37429aa532943fdb6ce6568b3d3176013a6b378.tar.gz
sssd-d37429aa532943fdb6ce6568b3d3176013a6b378.tar.xz
sssd-d37429aa532943fdb6ce6568b3d3176013a6b378.zip
IFP: Close memstream handle in introspect destructor
There was a resource leak in the introspection code. This patch fixes the leak. Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 09f6afae29a2e80655496f7f71a72e50424e6f1c)
-rw-r--r--src/sbus/sssd_dbus_introspect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus_introspect.c b/src/sbus/sssd_dbus_introspect.c
index c8e8c97a1..f310aeb74 100644
--- a/src/sbus/sssd_dbus_introspect.c
+++ b/src/sbus/sssd_dbus_introspect.c
@@ -58,6 +58,10 @@ struct introspect_ctx {
static int introspect_ctx_destructor(struct introspect_ctx *ictx)
{
+ if (ictx->f) {
+ fclose(ictx->f);
+ }
+
free(ictx->buf);
ictx->buf = NULL;
return 0;