Skip to content

Commit 5634cad

Browse files
committed
container: fix error leak
print the current error and release it. Closes: containers#1957 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1 parent 617e653 commit 5634cad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcrun/container.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,10 @@ do_hooks (runtime_spec_schema_config_schema *def, pid_t pid, const char *id, boo
813813
if (UNLIKELY (ret != 0))
814814
{
815815
if (keep_going)
816-
libcrun_warning ("error executing hook `%s` (exit code: %d)", hooks[i]->path, ret);
816+
{
817+
libcrun_warning ("error executing hook `%s` (exit code: %d)", hooks[i]->path, ret);
818+
crun_error_release (err);
819+
}
817820
else
818821
{
819822
libcrun_error (0, "error executing hook `%s` (exit code: %d)", hooks[i]->path, ret);

0 commit comments

Comments
 (0)