From ebec5783c4ff847d09816860261bbea34287ddf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 6 Aug 2013 21:30:34 -0400 Subject: [PATCH] systemd: fix segv in snapshot creation https://bugs.freedesktop.org/show_bug.cgi?id=67848 --- src/core/snapshot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/snapshot.c b/src/core/snapshot.c index 142385409..d11239dff 100644 --- a/src/core/snapshot.c +++ b/src/core/snapshot.c @@ -221,8 +221,10 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, DBusError *e, Sn if (asprintf(&n, "snapshot-%u.snapshot", ++ m->n_snapshots) < 0) return -ENOMEM; - if (!manager_get_unit(m, n)) + if (!manager_get_unit(m, n)) { + name = n; break; + } free(n); n = NULL; -- 2.30.2