From 3bed5265f9c792edfcd593eeaa93675711e5e264 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Mon, 23 Jul 2018 11:41:17 +0100 Subject: Cherrypick master patches up to 20th of July 2018. LP: #1781427 --- mapfile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mapfile.c') diff --git a/mapfile.c b/mapfile.c index f3c8191e..8d7acb3c 100644 --- a/mapfile.c +++ b/mapfile.c @@ -143,6 +143,8 @@ void map_unlock(struct map_ent **melp) unlink(mapname[2]); fclose(lf); } + if (*melp) + map_free(*melp); lf = NULL; } @@ -266,6 +268,7 @@ void map_remove(struct map_ent **mapp, char *devnm) map_delete(mapp, devnm); map_write(*mapp); map_free(*mapp); + *mapp = NULL; } struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]) -- cgit v1.2.3