Browse Source

Bugfix: RPC: Defer release of JSON until after cmd is used

Luke Dashjr 13 years ago
parent
commit
aff7e4ce83
1 changed files with 3 additions and 1 deletions
  1. 3 1
      api.c

+ 3 - 1
api.c

@@ -1021,7 +1021,6 @@ void api(void)
 							}
 							}
 						}
 						}
 					}
 					}
-					json_decref(json_config);
 				}
 				}
 
 
 				if (!did)
 				if (!did)
@@ -1034,6 +1033,9 @@ void api(void)
 						}
 						}
 					}
 					}
 
 
+				if (isjson)
+					json_decref(json_config);
+
 				if (!did) {
 				if (!did) {
 					strcpy(io_buffer, message(MSG_INVCMD, 0, isjson));
 					strcpy(io_buffer, message(MSG_INVCMD, 0, isjson));
 					send_result(c, isjson);
 					send_result(c, isjson);