Signed-off-by: Karel Zak <kzak@redhat.com>
#include "nls.h"
#include "setpwnam.h"
#include "strutils.h"
+#include "xalloc.h"
#ifdef HAVE_LIBSELINUX
# include <selinux/selinux.h>
char *p, *editor, *tk;
editor = getenv("EDITOR");
- editor = strdup(editor ? editor : _PATH_VI);
+ editor = xstrdup(editor ? editor : _PATH_VI);
tk = strtok(editor, " \t");
if (tk && (p = strrchr(tk, '/')) != NULL)
}
if (pid == -1 || !WIFEXITED(pstat) || WEXITSTATUS(pstat) != 0)
pw_error(editor, 1, 1);
+
+ free(editor);
}
void pw_error(char *name, int err, int eval)