Commit 369c9566 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Ulrich Sibiller

Fix memory leaks on _XimGetAttributeID error paths.

parent f50e651e
......@@ -1430,8 +1430,10 @@ _XimGetAttributeID(
bzero((char *)res, res_len);
values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len;
if (!(tmp = (XPointer)Xmalloc(values_len)))
if (!(tmp = (XPointer)Xmalloc(values_len))) {
Xfree(res);
return False;
}
bzero(tmp, values_len);
values_list = (XIMValuesList *)tmp;
......@@ -1477,8 +1479,10 @@ _XimGetAttributeID(
bzero((char *)res, res_len);
values_len = sizeof(XIMValuesList) + (sizeof(char **) * n) + names_len;
if (!(tmp = (XPointer)Xmalloc(values_len)))
if (!(tmp = (XPointer)Xmalloc(values_len))) {
Xfree(res);
return False;
}
bzero(tmp, values_len);
values_list = (XIMValuesList *)tmp;
......
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