summaryrefslogtreecommitdiffstats
path: root/sbin/mount_cd9660
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2009-11-20 15:28:38 +0000
committernetchild <netchild@FreeBSD.org>2009-11-20 15:28:38 +0000
commita74ed066d837994e27428f75e9df5cd7300f0b02 (patch)
tree08ba21ff1c97a054ef02e4b36e284b93a93a77df /sbin/mount_cd9660
parent42a48ae275cdb2d5513274f18028bd192ba0f48b (diff)
downloadFreeBSD-src-a74ed066d837994e27428f75e9df5cd7300f0b02.zip
FreeBSD-src-a74ed066d837994e27428f75e9df5cd7300f0b02.tar.gz
Fix minor memory leak in a function.
MFC after: 1 week
Diffstat (limited to 'sbin/mount_cd9660')
-rw-r--r--sbin/mount_cd9660/mount_cd9660.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c
index 9a9bd9d..922f6cf 100644
--- a/sbin/mount_cd9660/mount_cd9660.c
+++ b/sbin/mount_cd9660/mount_cd9660.c
@@ -251,8 +251,10 @@ set_charset(struct iovec **iov, int *iovlen, const char *localcs)
if ((cs_disk = malloc(ICONV_CSNMAXLEN)) == NULL)
return (-1);
- if ((cs_local = malloc(ICONV_CSNMAXLEN)) == NULL)
+ if ((cs_local = malloc(ICONV_CSNMAXLEN)) == NULL) {
+ free(cs_disk);
return (-1);
+ }
strncpy(cs_disk, ENCODING_UNICODE, ICONV_CSNMAXLEN);
strncpy(cs_local, kiconv_quirkcs(localcs, KICONV_VENDOR_MICSFT),
ICONV_CSNMAXLEN);
OpenPOWER on IntegriCloud