From: Matthew Dillon Date: Sat, 21 Oct 2017 23:31:30 +0000 (-0700) Subject: swapon - Fix minor memory leak X-Git-Tag: v5.3.0~983 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/08c0d58deef5ae64848e5e4437889f7104f64094 swapon - Fix minor memory leak * Fix a minor memory leak Reported-by: liweitianux bug #3086 --- diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index fb8a578263..0a08f79b5f 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -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: