Commit d9a8f8cd authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

Fix leak in error path

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9fc361de
......@@ -85,8 +85,10 @@ static inline char *ToCodePage (unsigned cp, const char *utf8)
return NULL;
size_t len = WideCharToMultiByte (cp, 0, wide, -1, NULL, 0, NULL, NULL);
if (len == 0)
if (len == 0) {
free(wide);
return NULL;
}
char *out = (char *)malloc (len);
if (likely(out != NULL))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment