diff options
| author | Daniel Golle | 2021-08-14 17:30:48 +0000 |
|---|---|---|
| committer | Daniel Golle | 2021-08-14 17:53:21 +0000 |
| commit | 2e3aca299ea7bbe74f219860510c4b34e77c7aa4 (patch) | |
| tree | 24e0de6b41e08a6060aa1a7a6dd9da46cac0d38c | |
| parent | a77c4fac6f059e24257bf6fa810be03b4b9d7951 (diff) | |
| download | fstools-2e3aca299ea7bbe74f219860510c4b34e77c7aa4.tar.gz | |
block: fix two resources leaks discovered by Coverity
Coverity CID: 1412456 Resource leak
Coverity CID: 1412458 Resource leak
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | block.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -931,6 +931,8 @@ static int handle_mount(const char *source, const char *target, err = exec_mount(source, target, fstype, mount_opts); } + free(mount_opts); + return err; } @@ -1131,9 +1133,10 @@ static int umount_device(char *path, int type, bool all) if (!mp) return -1; - if (!strcmp(mp, "/") && !all) + if (!strcmp(mp, "/") && !all) { + free(mp); return 0; - + } if (type != TYPE_AUTOFS) blockd_notify("umount", basename(path), NULL, NULL); |