Commit 04a620c0 authored by Petri Hintukainen's avatar Petri Hintukainen

Fix leak (error path)

parent 2e4197e6
...@@ -176,17 +176,19 @@ static char *_cs0_to_utf8(const uint8_t *cs0, size_t size) ...@@ -176,17 +176,19 @@ static char *_cs0_to_utf8(const uint8_t *cs0, size_t size)
size_t out_pos = 0; size_t out_pos = 0;
size_t out_size = size; size_t out_size = size;
size_t i; size_t i;
uint8_t *out = (uint8_t *)malloc(size); uint8_t *out;
if (!out) {
udf_error("out of memory\n");
return NULL;
}
if (size < 1) { if (size < 1) {
udf_error("too short cs0 string\n"); udf_error("too short cs0 string\n");
return NULL; return NULL;
} }
out = (uint8_t *)malloc(size);
if (!out) {
udf_error("out of memory\n");
return NULL;
}
switch (cs0[0]) { switch (cs0[0]) {
case 8: case 8:
/*udf_trace("string in utf-8\n");*/ /*udf_trace("string in utf-8\n");*/
......
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