diff --git a/lib/libc/iconv/citrus_iconv.c b/lib/libc/iconv/citrus_iconv.c index 941ee0255ecb..04acccf1bba4 100644 --- a/lib/libc/iconv/citrus_iconv.c +++ b/lib/libc/iconv/citrus_iconv.c @@ -258,7 +258,7 @@ int _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv, const char * __restrict src, const char * __restrict dst) { - struct _citrus_iconv *cv; + struct _citrus_iconv *cv = NULL; struct _citrus_iconv_shared *ci = NULL; char realdst[PATH_MAX], realsrc[PATH_MAX]; char buf[PATH_MAX], path[PATH_MAX]; @@ -301,7 +301,7 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv, ret = (*ci->ci_ops->io_init_context)(*rcv); if (ret) { release_shared(ci); - free(*rcv); + free(cv); return (ret); } return (0);