summaryrefslogtreecommitdiff
path: root/utils/update-alternatives.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/update-alternatives.c')
-rw-r--r--utils/update-alternatives.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index a4f38a332..5f4364b09 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -455,6 +455,7 @@ subcall(const char *prog, ...)
/* Run the command */
res = spawn(prog, cmd);
+ free(cmd);
if (WIFEXITED(res) && WEXITSTATUS(res) == 0)
return;
if (WIFEXITED(res))
@@ -2532,7 +2533,8 @@ main(int argc, char **argv)
char *slink, *sname, *spath;
struct slave_link *sl;
- if (action && strcmp(action, "install") != 0)
+ if (action == NULL ||
+ (action && strcmp(action, "install") != 0))
badusage(_("--slave only allowed with --install"));
if (MISSING_ARGS(3))
badusage(_("--slave needs <link> <name> <path>"));