projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7774a8
)
core/execute: use assertion for _done function
author
Mike Yuan
<me@yhndnzj.com>
Wed, 20 Dec 2023 13:56:49 +0000
(21:56 +0800)
committer
Mike Yuan
<me@yhndnzj.com>
Wed, 20 Dec 2023 13:56:49 +0000
(21:56 +0800)
As per our usual coding style.
src/core/execute.c
patch
|
blob
|
history
diff --git
a/src/core/execute.c
b/src/core/execute.c
index 3b223a3aceda50c861c8a15e566d746a8cc89fd8..da55ef0564b77ed7d6ced15695f9c0583460f011 100644
(file)
--- 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);
}