From a3812603159b7b77ed67a5f599a0f7828f9b8a00 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Sun, 20 Mar 2022 06:38:58 +0000 Subject: [PATCH] Fix malloc callbacks for status FossilOrigin-Name: 3152362dbe0f532a8fcea4e17c1e234e1be9fc6e841d1cc74992094b3de834a2 --- src/account.c | 6 +++--- src/status.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/account.c b/src/account.c index e8252f5..b79c0f0 100644 --- a/src/account.c +++ b/src/account.c @@ -28,17 +28,17 @@ void _mstdnt_val_account_call(cJSON* v, void* _type) { struct mstdnt_account* type = _type; - mstdnt_account_from_json(type, v); + mstdnt_account_from_json(type, v->child); } void _mstdnt_val_malloc_account_call(cJSON* v, void* _type) { struct mstdnt_account** type = _type; - *type = malloc(sizeof(struct mstdnt_account*)); + *type = malloc(sizeof(struct mstdnt_account)); if (*type) - mstdnt_account_from_json(*type, v); + mstdnt_account_from_json(*type, v->child); } int mstdnt_account_from_result(struct mstdnt_fetch_results* results, diff --git a/src/status.c b/src/status.c index 4edc32a..6dd6005 100644 --- a/src/status.c +++ b/src/status.c @@ -26,7 +26,7 @@ void _mstdnt_val_status_call(cJSON* v, void* _type) { struct mstdnt_status* type = _type; - mstdnt_status_from_json(type, v); + mstdnt_status_from_json(type, v->child); } @@ -34,10 +34,10 @@ void _mstdnt_val_malloc_status_call(cJSON* v, void* _type) { struct mstdnt_status** type = _type; - *type = malloc(sizeof(struct mstdnt_status*)); + *type = malloc(sizeof(struct mstdnt_status)); if (*type) - mstdnt_status_from_json(*type, v); + mstdnt_status_from_json(*type, v->child); } int mstdnt_status_from_json(struct mstdnt_status* status, cJSON* js)