From e03975b90fee0ac92ba2958cf12d60cf36343be5 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 20 Dec 2023 21:56:49 +0800 Subject: [PATCH] core/execute: use assertion for _done function As per our usual coding style. --- src/core/execute.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/execute.c b/src/core/execute.c index 3b223a3aced..da55ef0564b 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1955,8 +1955,7 @@ static char *destroy_tree(char *path) { } void exec_shared_runtime_done(ExecSharedRuntime *rt) { - if (!rt) - return; + assert(rt); if (rt->manager) (void) hashmap_remove(rt->manager->exec_shared_runtime_by_id, rt->id); @@ -1969,8 +1968,10 @@ void exec_shared_runtime_done(ExecSharedRuntime *rt) { } static ExecSharedRuntime* exec_shared_runtime_free(ExecSharedRuntime *rt) { - exec_shared_runtime_done(rt); + if (!rt) + return NULL; + exec_shared_runtime_done(rt); return mfree(rt); } -- 2.47.3