Commit 748cf894 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Ulrich Sibiller

om: Fix potential memory leak in init_om.

parent 6fe8d44c
......@@ -2094,23 +2094,25 @@ init_om(
if (required_list == NULL)
return False;
bufptr = (char *) Xmalloc(length);
if (bufptr == NULL) {
Xfree(required_list);
return False;
}
om->core.required_charset.charset_list = required_list;
om->core.required_charset.charset_count = gen->data_num;
count = gen->data_num;
data = gen->data;
if (count > 0) {
bufptr = (char *) Xmalloc(length);
if (bufptr == NULL) {
Xfree(required_list);
return False;
}
for ( ; count-- > 0; data++) {
strcpy(bufptr, data->font_data->name);
*required_list++ = bufptr;
bufptr += strlen(bufptr) + 1;
}
}
/* orientation list */
orientation = (XOrientation *) Xmalloc(sizeof(XOrientation) * 2);
......
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