summaryrefslogtreecommitdiffstats
path: root/source/lib/iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/iconv.c')
-rw-r--r--source/lib/iconv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/iconv.c b/source/lib/iconv.c
index 66a6e6cd8bc..d58165fed03 100644
--- a/source/lib/iconv.c
+++ b/source/lib/iconv.c
@@ -209,15 +209,15 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode)
from = charsets;
to = charsets;
- ret = (smb_iconv_t)malloc(sizeof(*ret));
+ ret = SMB_MALLOC_P(struct _smb_iconv_t);
if (!ret) {
errno = ENOMEM;
return (smb_iconv_t)-1;
}
- memset(ret, 0, sizeof(*ret));
+ memset(ret, 0, sizeof(struct _smb_iconv_t));
- ret->from_name = strdup(fromcode);
- ret->to_name = strdup(tocode);
+ ret->from_name = SMB_STRDUP(fromcode);
+ ret->to_name = SMB_STRDUP(tocode);
/* check for the simplest null conversion */
if (strcasecmp(fromcode, tocode) == 0) {