From: Michael Stapelberg Date: Tue, 9 Aug 2011 06:41:42 +0000 (+0200) Subject: Bugfix: don’t free the old json_output, the caller does that X-Git-Tag: 4.0.2~48^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd1add1f3c0c7b638a20b810822838c5ecb7bc2d;p=i3%2Fi3 Bugfix: don’t free the old json_output, the caller does that --- diff --git a/src/cmdparse.y b/src/cmdparse.y index 32558f2e..9b63ff0c 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -81,13 +81,13 @@ int cmdyywrap() { } char *parse_cmd(const char *new) { + json_output = NULL; LOG("COMMAND: *%s*\n", new); cmdyy_scan_string(new); match_init(¤t_match); context = scalloc(sizeof(struct context)); context->filename = "cmd"; - FREE(json_output); if (cmdyyparse() != 0) { fprintf(stderr, "Could not parse command\n"); asprintf(&json_output, "{\"success\":false, \"error\":\"%s at position %d\"}",