From c05294e2c56078f912abc27766981590e64e40c3 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 30 Dec 2022 16:38:30 -0600 Subject: [PATCH] base: Remove unused variable assignment in JSON string parsing --- lib/base/json.c | 2 +- lib/base/log.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/base/json.c b/lib/base/json.c index c7ef06588..4fa0f2d5a 100644 --- a/lib/base/json.c +++ b/lib/base/json.c @@ -893,7 +893,7 @@ parse_string(struct parse_ctx *ctx) continue; /* This will cause p0 to be realloc'ed */ } p_save = ctx->p; - ctop = cbot = -3; + cbot = -3; ctop = unescape_unicode(ctx); if (ctop == -1 && strict) return parse_string_error(ctx, p0, "Invalid escaped Unicode"); diff --git a/lib/base/log.c b/lib/base/log.c index 80965f5bb..353e070ed 100644 --- a/lib/base/log.c +++ b/lib/base/log.c @@ -227,6 +227,8 @@ open_syslog(heim_context context, close_syslog, sd); if (ret) free(sd); + else + sd = NULL; return ret; } @@ -348,6 +350,7 @@ open_file(heim_context context, heim_log_facility *fac, int min, int max, free(fd); } else if (disp & FILEDISP_KEEPOPEN) { log_file(context, NULL, NULL, fd); + fd = NULL; } return ret; }