]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: don’t free the old json_output, the caller does that
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 9 Aug 2011 06:41:42 +0000 (08:41 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 9 Aug 2011 07:27:28 +0000 (09:27 +0200)
src/cmdparse.y

index 32558f2ea6af5f7b94a122451aa0e11340a3703d..9b63ff0cdcd147ba1b8c946a8c3002ba301ae81e 100644 (file)
@@ -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(&current_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\"}",