More potential memory leaks squashed.
@@ -164,7 +164,11 @@ int nc_utf8_to_utf16(const unsigned char* s8, unsigned short** utf16p, size_t* l
}
}
*p16++ = (unsigned short)0;
- if(utf16p) *utf16p = utf16;
+ if(utf16p)
+ *utf16p = utf16;
+ else
+ free(utf16);
+
if(len16p) *len16p = len16;
done:
if(ncstat) free(utf16);
