wbinfo: Fix several memory leaks.
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 08:43:44 +0000 (09:43 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:13 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
nsswitch/wbinfo.c

index b96b73c2bfa5c037577c781d7045fefe20b1aa86..cd6de34fd5e9f3a8b409bee3bc6d4c0d183c2dc6 100644 (file)
@@ -243,6 +243,8 @@ static bool wbinfo_get_user_sidinfo(const char *sid_str)
                 pwd->pw_dir,
                 pwd->pw_shell);
 
+       wbcFreeMemory(pwd);
+
        return true;
 }
 
@@ -1227,6 +1229,9 @@ static bool wbinfo_lookupsid(const char *sid_str)
        d_printf("%s%c%s %d\n",
                 domain, winbind_separator(), name, type);
 
+       wbcFreeMemory(domain);
+       wbcFreeMemory(name);
+
        return true;
 }
 
@@ -1261,6 +1266,9 @@ static bool wbinfo_lookupsid_fullname(const char *sid_str)
        d_printf("%s%c%s %d\n",
                 domain, winbind_separator(), name, type);
 
+       wbcFreeMemory(domain);
+       wbcFreeMemory(name);
+
        return true;
 }