]> Dogcows Code - chaz/openbox/commitdiff
malloc. yeah.
authorDerek Foreman <manmower@gmail.com>
Sun, 16 Mar 2003 23:49:05 +0000 (23:49 +0000)
committerDerek Foreman <manmower@gmail.com>
Sun, 16 Mar 2003 23:49:05 +0000 (23:49 +0000)
render/render.c

index 71e5f7b3390f9d899965fb509dbda37ea704d1c0..560ee38e67e2581753ef39a18c8494e941a3c66c 100644 (file)
@@ -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;
This page took 0.026363 seconds and 4 git commands to generate.