File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 33
33
#include <stdlib.h>
34
34
#include <stdio.h>
35
35
#include <string.h>
36
- #include "zmalloc.h"
37
36
#include "request.h"
38
37
39
38
/* useful symbols:
@@ -147,7 +146,7 @@ int request_parse(struct request *req)
147
146
}
148
147
req -> argc = atoi (sb );
149
148
150
- req -> argv = (char * * )zmalloc ( sizeof (char * )* req -> argc );
149
+ req -> argv = (char * * )calloc ( req -> argc , sizeof (char * ));
151
150
for (i = 0 ;i < req -> argc ;i ++ ){
152
151
int argv_len ;
153
152
char * v ;
@@ -161,7 +160,7 @@ int request_parse(struct request *req)
161
160
argv_len = atoi (sb );
162
161
163
162
/*get argv*/
164
- v = (char * )zmalloc (sizeof (char )* argv_len );
163
+ v = (char * )malloc (sizeof (char )* argv_len );
165
164
memcpy (v ,req -> querybuf + (req -> pos ),argv_len );
166
165
req -> argv [i ]= v ;
167
166
req -> pos += (argv_len + 2 );
@@ -189,9 +188,9 @@ void request_free(struct request *req)
189
188
if (req ){
190
189
for (i = 0 ;i < req -> argc ;i ++ ){
191
190
if (req -> argv [i ])
192
- zfree (req -> argv [i ]);
191
+ free (req -> argv [i ]);
193
192
}
194
- zfree (req -> argv );
193
+ free (req -> argv );
195
194
free (req );
196
195
}
197
196
}
You can’t perform that action at this time.
0 commit comments