File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,11 @@ int write_test_policy_from_file(const char *filename) {
99
99
char * buf = NULL ;
100
100
size_t len = 0 ;
101
101
FILE * fptr = fopen (filename , "rb" );
102
+ int ret = -1 ;
102
103
103
104
if (!fptr ) {
104
105
perror ("fopen" );
105
- return -1 ;
106
+ return ret ;
106
107
}
107
108
108
109
fseek (fptr , 0 , SEEK_END );
@@ -114,13 +115,15 @@ int write_test_policy_from_file(const char *filename) {
114
115
if (!buf ) {
115
116
perror ("malloc" );
116
117
fclose (fptr );
117
- return -1 ;
118
+ return ret ;
118
119
}
119
120
120
121
fread (buf , len , 1 , fptr );
121
122
fclose (fptr );
122
123
123
- return write_test_policy (buf , len );
124
+ ret = write_test_policy (buf , len );
125
+ free (buf );
126
+ return ret ;
124
127
}
125
128
126
129
int write_test_policy_src (unsigned char * data , unsigned int data_len ) {
You can’t perform that action at this time.
0 commit comments