From 9bfc8881cb712a6b164f08ca3d70ec99745e6c22 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 25 Feb 2018 16:17:42 +0100 Subject: [PATCH] coverity: missing free on error path --- daemons/dmfilemapd/dmfilemapd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemons/dmfilemapd/dmfilemapd.c b/daemons/dmfilemapd/dmfilemapd.c index aa50242ec..7519799d1 100644 --- a/daemons/dmfilemapd/dmfilemapd.c +++ b/daemons/dmfilemapd/dmfilemapd.c @@ -802,7 +802,7 @@ bad: return 1; } -static const char * _mode_names[] = { +static const char * const _mode_names[] = { "inode", "path" }; @@ -827,8 +827,10 @@ int main(int argc, char **argv) "mode=%s, path=%s", fm.fd, fm.group_id, _mode_names[fm.mode], fm.path); - if (!_foreground && !_daemonise(&fm)) + if (!_foreground && !_daemonise(&fm)) { + dm_free(fm.path); return 1; + } return _dmfilemapd(&fm); } -- 2.43.5