Diff between 1c1f807c304a77ae4965f00ccee04fdbe7415d5e and 5aa0dd42f7b45b5ef2bceb8510aeb2a892866abf

Changed Files

File Additions Deletions Status
src/shared/shell.c +7 -2 modified

Full Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 0a05b52..7417e7a 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -643,8 +643,13 @@ static char *cmd_generator(const char *text, int state)
 	}
 
 	cmd = find_cmd(text + strlen(menu->name) + 1, menu->entries, &index);
-	if (cmd)
-		asprintf(&cmd, "%s.%s", menu->name, cmd);
+	if (cmd) {
+		int err;
+
+		err = asprintf(&cmd, "%s.%s", menu->name, cmd);
+		if (err < 0)
+			return NULL;
+	}
 
 	return cmd;
 }