diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-06-20 19:01:54 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-06-20 19:01:54 +0200 |
commit | 913c2ecc76742983ee9d21c257be907cbb537e65 (patch) | |
tree | 87e4804e6c7f6bb9c3795c18d0aaa986e7d93a4c /src/lib | |
parent | b2c046a3f65f823ff6fbfef4f9c96e876aed56dc (diff) | |
download | anastasis-913c2ecc76742983ee9d21c257be907cbb537e65.tar.gz anastasis-913c2ecc76742983ee9d21c257be907cbb537e65.tar.bz2 anastasis-913c2ecc76742983ee9d21c257be907cbb537e65.zip |
-fix recdoc use-after-free
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/anastasis_recovery.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index e844737..f94e946 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c @@ -626,6 +626,7 @@ policy_lookup_cb (void *cls, json_error_t json_error; const json_t *dec_policies; const json_t *esc_methods; + json_t *recovery_document; r->plo = NULL; switch (http_status) @@ -698,7 +699,6 @@ policy_lookup_cb (void *cls, return; } { - json_t *recovery_document; uint32_t be_size; uLongf pt_size; char *pt; @@ -799,7 +799,6 @@ policy_lookup_cb (void *cls, r->ri.secret_name = r->secret_name; } } - json_decref (recovery_document); } r->ri.version = dd->version; @@ -853,6 +852,7 @@ policy_lookup_cb (void *cls, NULL, 0); ANASTASIS_recovery_abort (r); + json_decref (recovery_document); return; } cs->url = GNUNET_strdup (url); @@ -893,6 +893,7 @@ policy_lookup_cb (void *cls, NULL, 0); ANASTASIS_recovery_abort (r); + json_decref (recovery_document); return; } @@ -923,6 +924,7 @@ policy_lookup_cb (void *cls, NULL, 0); ANASTASIS_recovery_abort (r); + json_decref (recovery_document); return; } for (unsigned int i = 0; i<r->ri.cs_len; i++) @@ -943,12 +945,14 @@ policy_lookup_cb (void *cls, NULL, 0); ANASTASIS_recovery_abort (r); + json_decref (recovery_document); return; } } } r->pc (r->pc_cls, &r->ri); + json_decref (recovery_document); } |