Avoid dereferencing NULL pointers.

This commit is contained in:
Murilo Pereira
2011-02-12 01:26:03 -02:00
parent 97c69bdcba
commit 60641ca499
4 changed files with 23 additions and 17 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ void initialize_stack(struct stack *stack) {
}
void delete_stack(struct stack *stack) {
delete_card(stack->card);
if (stack) {
delete_card(stack->card);
}
free(stack);
return;