smbpasswd: Don't leak memory.
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 09:25:55 +0000 (10:25 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:14 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/utils/smbpasswd.c

index 3af7e56f7d4ec5af7a333f693536c273c9c3e45d..d93261eade342efb7505e3c6ec25863bdbf69f42 100644 (file)
@@ -137,6 +137,7 @@ static int process_options(int argc, char **argv, int local_flags)
                case 'n':
                        local_flags |= LOCAL_SET_NO_PASSWORD;
                        local_flags &= ~LOCAL_SET_PASSWORD;
+                       SAFE_FREE(new_passwd);
                        new_passwd = smb_xstrdup("NO PASSWORD");
                        break;
                case 'r':