We need to malloc() the size of the structure, not the pointer.
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user