Skip to contentSkip to conversation

master - dmfilemapd: free path

PATCH Zdenek Kabelac 1 participant 1 message Apr 12, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3e3f2a53eaa5979d2c32b231f528e7b99c55675e
Commit:        3e3f2a53eaa5979d2c32b231f528e7b99c55675e
Parent:        dfc083d8d66cf3286908e9c7fc0c53bd1e5d4967
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Apr 1 12:11:41 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Apr 12 21:33:47 2017 +0200

dmfilemapd: free path

Cleanup resources before exit.

---
 daemons/dmfilemapd/dmfilemapd.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
daemons/dmfilemapd/dmfilemapd.c +4 -1
index d232a83..2dd069a 100644
@@ -533,6 +533,7 @@ static void _filemap_monitor_destroy(struct filemap_monitor *fm)
 		_filemap_monitor_close_fd(fm);
 	}
 	dm_free((void *) fm->program_id);
+	dm_free(fm->path);
 }
 
 static int _filemap_monitor_check_same_file(int fd1, int fd2)
@@ -800,8 +801,10 @@ int main(int argc, char **argv)
 {
 	struct filemap_monitor fm;
 
-	if (!_parse_args(argc, argv, &fm))
+	if (!_parse_args(argc, argv, &fm)) {
+		dm_free(fm.path);
 		return 1;
+	}
 
 	_setup_logging();