From 6beda1bcee4396ceced99b8a8c5627940f507ace Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 20 Dec 2020 23:09:31 +0000 Subject: internals: error tracing: record the not-found path upon ENOENT as needed. --- src/driver/slbt_driver_ctx.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/driver') diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index b105c2b..4812076 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -1755,6 +1755,17 @@ int slbt_get_driver_ctx( static void slbt_free_driver_ctx_impl(struct slbt_driver_ctx_alloc * ictx) { + struct slbt_error_info ** perr; + struct slbt_error_info * erri; + + for (perr=ictx->ctx.errinfp; *perr; perr++) { + erri = *perr; + + if (erri->eany && (erri->esyscode == ENOENT)) + free(erri->eany); + } + + if (ictx->ctx.libname) free(ictx->ctx.libname); @@ -1807,11 +1818,11 @@ int slbt_set_alternate_host( slbt_free_host_params(&ictx->ctx.ahost); if (!(ictx->ctx.ahost.host = strdup(host))) - return SLBT_SYSTEM_ERROR(ctx); + return SLBT_SYSTEM_ERROR(ctx,0); if (!(ictx->ctx.ahost.flavor = strdup(flavor))) { slbt_free_host_params(&ictx->ctx.ahost); - return SLBT_SYSTEM_ERROR(ctx); + return SLBT_SYSTEM_ERROR(ctx,0); } ictx->ctx.cctx.ahost.host = ictx->ctx.ahost.host; -- cgit v1.2.3