From f8ad321e50c7838a747b3314676ab24ee4d0e423 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Sun, 16 Mar 2003 23:49:05 +0000 Subject: [PATCH] malloc. yeah. --- render/render.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/render/render.c b/render/render.c index 71e5f7b3..560ee38e 100644 --- a/render/render.c +++ b/render/render.c @@ -177,7 +177,10 @@ Appearance *appearance_copy(Appearance *orig) break; } copy->textures = orig->textures; - memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); + if (orig->textures) { + copy->texture = malloc(orig->textures * sizeof(Texture)); + memcpy(copy->texture, orig->texture, orig->textures * sizeof(Texture)); + } else copy->texture = NULL; copy->pixmap = None; copy->xftdraw = NULL; return copy; -- 2.45.2