swapon - Fix minor memory leak
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Oct 2017 23:31:30 +0000 (16:31 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 21 Oct 2017 23:31:30 +0000 (16:31 -0700)
* Fix a minor memory leak

Reported-by: liweitianux bug #3086
sbin/swapon/swapon.c

index fb8a578..0a08f79 100644 (file)
@@ -238,6 +238,7 @@ docrypt(char *fs_spec, int pass)
                        break;
                asprintf(&buf, "/sbin/cryptsetup remove %s", id);
                system(buf);
+               free(buf);
                free(id);
                break;
        case SWAPON: