From d534994b4e9b1bd6517ef39f2182c7e0b375159b Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 17 Jan 2008 18:12:07 +0000 Subject: [PATCH] relative: Fix potential NULL dereference (ALT#14067) --- tools/relative.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/relative.c b/tools/relative.c index 4e3c7c4..97535fd 100644 --- a/tools/relative.c +++ b/tools/relative.c @@ -106,9 +106,7 @@ main(int ac, char *av[]) { const char *orig_what; char *what_p, *to_p, *res; - - char *what = xstrdup(av[1]); - char *to = xstrdup(av[2]); + char *what, *to; if (ac < 3) { @@ -117,6 +115,9 @@ main(int ac, char *av[]) return 1; } + what = xstrdup(av[1]); + to = xstrdup(av[2]); + orig_what = normalize(av[1]); normalize(av[2]);