id: unsigned long is excessive for option bitmask
[oweals/busybox.git] / loginutils / chpasswd.c
index 25145fd1c670275967bbae234a3de0ad648fe1d7..c83d1dad78c5a3bc0dfad776de5b653382d758ca 100644 (file)
@@ -65,8 +65,8 @@ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
                        bb_info_msg("Password for '%s' changed", name);
                logmode = LOGMODE_STDIO;
                free(name);
-               free(pass);
+               if (!(opt & OPT_ENC))
+                       free(pass);
        }
-
-       return 0;
+       return EXIT_SUCCESS;
 }