s4:regshell - fix an "asprintf"
[bbaumbach/samba-autobuild/.git] / source4 / lib / registry / tools / regshell.c
index d25fee14fd3bd473b40c23e704e49354ccaf8153..993fe3d79171c3d20044684e67f5b7e1f27234d3 100644 (file)
@@ -622,7 +622,11 @@ int main(int argc, char **argv)
        while (true) {
                char *line, *prompt;
 
-               asprintf(&prompt, "%s\\%s> ", ctx->predef?ctx->predef:"", ctx->path);
+               if (asprintf(&prompt, "%s\\%s> ", ctx->predef?ctx->predef:"",
+                            ctx->path) < 0) {
+                       ret = false;
+                       break;
+               }
 
                current_key = ctx->current;             /* No way to pass a void * pointer
                                                           via readline :-( */