File tree Expand file tree Collapse file tree 3 files changed +106
-191
lines changed Expand file tree Collapse file tree 3 files changed +106
-191
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ int main(int argc, char **argv) {
34
34
// printf("HEAD LEN %u \t| HEAD TYPE %u \t| DESC ", head.messageLen, head.type);
35
35
36
36
/* Retrieve the message body */
37
- if (body != NULL )
38
- free (body );
37
+ // if (body != NULL)
38
+ // free(body);
39
39
if (head .messageLen > 0 ) {
40
40
body = malloc (head .messageLen * sizeof (char ));
41
41
if (read (0 , body , head .messageLen ) <= 0 ) {
@@ -47,23 +47,32 @@ int main(int argc, char **argv) {
47
47
// And interpret it
48
48
switch (head .type ) {
49
49
case Done :
50
+ // validationListPrint(validation_list);
50
51
destroySchema (journal_array , relation_count );
51
52
validationListDestroy (validation_list );
52
53
return EXIT_SUCCESS ;
53
54
case DefineSchema :
54
55
journal_array = processDefineSchema (body , & relation_count , tid_mode );
56
+ if (body != NULL )
57
+ free (body );
55
58
break ;
56
59
case Transaction :
57
60
processTransaction (body ,journal_array );
61
+ if (body != NULL )
62
+ free (body );
58
63
break ;
59
64
case ValidationQueries :
60
65
processValidationQueries (body ,journal_array ,validation_list );
61
66
break ;
62
67
case Flush :
63
68
processFlush (body ,journal_array ,validation_list );
69
+ if (body != NULL )
70
+ free (body );
64
71
break ;
65
72
case Forget :
66
73
processForget (body ,journal_array );
74
+ if (body != NULL )
75
+ free (body );
67
76
break ;
68
77
default :
69
78
exit (EXIT_FAILURE ); // crude error handling, should never happen
You can’t perform that action at this time.
0 commit comments