[PATCH 1/3] Refix concat_cmdline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When removing the potential leak the logic was flipped which
mean we never reached the case for handling when both parameters
were set.

Signed-off-by: Eric W. Biederman <ebiederm at aristanetworks.com>
---
 kexec/kexec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index d282ade..43d0189 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1007,9 +1007,9 @@ char *concat_cmdline(const char *base, const char *append)
 	char *cmdline;
 	if (!base && !append)
 		return NULL;
-	if (append)
+	if (append && !base)
 		return xstrdup(append);
-	if (base)
+	if (base && !append)
 		return xstrdup(base);
 	cmdline = xmalloc(strlen(base) + 1 + strlen(append) + 1);
 	strcpy(cmdline, base);
-- 
1.6.6.1




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux