We need to malloc() the size of the structure, not the pointer.

This commit is contained in:
Murilo Soares Pereira
2010-04-04 21:00:36 -03:00
parent abca15d2be
commit 155e03e42c
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
struct card *initialize_card() {
struct card *card = NULL;
card = malloc(sizeof(card));
card = malloc(sizeof(*card));
card->frame = initialize_frame();
card->value = NO_VALUE;