all repos — openbox @ 7bd747389d3463b00919fd21dfb21d31feb2c3f8

openbox fork - make it a bit more like ryudo

initialize texture to NULL if theres no textures. use g_memdup to copy it
Dana Jansens danakj@orodu.net
commit

7bd747389d3463b00919fd21dfb21d31feb2c3f8

parent

4bceaaf16550a2149d8b4a7315ce8356d700f2ce

1 files changed, 3 insertions(+), 4 deletions(-)

jump to
M render/render.crender/render.c

@@ -141,6 +141,7 @@ out->surface.type = type;

out->textures = numtex; out->xftdraw = NULL; if (numtex) out->texture = g_new(Texture, numtex); + else out->texture = NULL; out->pixmap = None; switch (type) {

@@ -191,10 +192,8 @@ spc->pixel_data = NULL;

break; } copy->textures = orig->textures; - if (orig->textures) { - copy->texture = malloc(orig->textures * sizeof(Texture)); - memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); - } else copy->texture = NULL; + copy->texture = g_memdup(orig->texture, + orig->textures * sizeof(Texture)); copy->pixmap = None; copy->xftdraw = NULL; return copy;