diff --git a/poke/pk-mi-json.c b/poke/pk-mi-json.c index b32a1194..a21bd77c 100644 --- a/poke/pk-mi-json.c +++ b/poke/pk-mi-json.c @@ -31,14 +31,14 @@ #define PK_MI_CHECK(errmsg, A, M, ...) \ do \ { \ - int r; \ if (A) \ break; \ if (errmsg != NULL && \ - (r = asprintf (errmsg, "[ERROR] " M , ##__VA_ARGS__)) == -1) { \ - *errmsg = NULL; \ - assert (0 && "asprintf () failed"); \ - } \ + asprintf (errmsg, "[ERROR] " M , ##__VA_ARGS__) == -1) \ + { \ + *errmsg = NULL; \ + assert (0 && "asprintf () failed"); \ + } \ goto error; \ } \ while (0) @@ -449,8 +449,11 @@ pk_mi_json_to_msg (const char *str) if (json) { + int freed_p; + msg = pk_mi_json_object_to_msg (json); - assert (json_object_put (json) == 1); + freed_p = json_object_put (json); + assert (freed_p == 1); } return msg;