summaryrefslogtreecommitdiffstats
path: root/src/oom
diff options
context:
space:
mode:
Diffstat (limited to 'src/oom')
-rw-r--r--src/oom/oomd-manager.c3
-rw-r--r--src/oom/oomd-util.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/oom/oomd-manager.c b/src/oom/oomd-manager.c
index 08a29ec77b..3f050cdbb2 100644
--- a/src/oom/oomd-manager.c
+++ b/src/oom/oomd-manager.c
@@ -847,6 +847,9 @@ int manager_get_dump_string(Manager *m, char **ret) {
f = safe_fclose(f);
+ if (!dump)
+ return -ENOMEM;
+
*ret = TAKE_PTR(dump);
return 0;
}
diff --git a/src/oom/oomd-util.c b/src/oom/oomd-util.c
index 49c10b5e16..6309d2c473 100644
--- a/src/oom/oomd-util.c
+++ b/src/oom/oomd-util.c
@@ -299,6 +299,11 @@ static int dump_kill_candidates(OomdCGroupContext **sorted, int n, int dump_unti
if (r < 0)
return r;
+ f = safe_fclose(f);
+
+ if (!dump)
+ return -ENOMEM;
+
return log_dump(LOG_INFO, dump);
}