svn commit: r199584 - head/sbin/mount_cd9660
Alexander Leidinger
netchild at FreeBSD.org
Fri Nov 20 15:28:39 UTC 2009
Author: netchild
Date: Fri Nov 20 15:28:38 2009
New Revision: 199584
URL: http://svn.freebsd.org/changeset/base/199584
Log:
Fix minor memory leak in a function.
MFC after: 1 week
Modified:
head/sbin/mount_cd9660/mount_cd9660.c
Modified: head/sbin/mount_cd9660/mount_cd9660.c
==============================================================================
--- head/sbin/mount_cd9660/mount_cd9660.c Fri Nov 20 15:27:52 2009 (r199583)
+++ head/sbin/mount_cd9660/mount_cd9660.c Fri Nov 20 15:28:38 2009 (r199584)
@@ -251,8 +251,10 @@ set_charset(struct iovec **iov, int *iov
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);
More information about the svn-src-head
mailing list