From 20ae606a7e474bcc817571c7f50da3dab9373ca9 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 11 Nov 2014 08:00:58 -0700 Subject: [PATCH] layers: Restore dynamic malloc fix in xgl-helper.py --- xgl-helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xgl-helper.py b/xgl-helper.py index af703a5..dd176ce 100755 --- a/xgl-helper.py +++ b/xgl-helper.py @@ -503,8 +503,8 @@ class StructWrapperGen: tmp_p_out += ' %spNext (%p)\\n%s\\n"' tmp_p_args += ", prefix, (void*)pStruct->pNext, pTmpStr);\n" sh_funcs.append(' } else {\n') - sh_funcs.append(' str = (char*)malloc(sizeof(char)*2048);\n') sh_funcs.append(' char *pTmpStr = dynamic_display((XGL_VOID*)pStruct->pNext, prefix);\n') + sh_funcs.append(' str = (char*)malloc(strlen(pTmpStr) + sizeof(char)*1024);\n') sh_funcs.append(' sprintf(str, "') sh_funcs.append('%s%s' % (tmp_p_out, tmp_p_args)) sh_funcs.append(' free(pTmpStr);\n') -- 2.7.4