version 1.7.2.4, 2012/05/18 13:37:48
|
version 1.8.2.3, 2012/05/23 14:06:08
|
Line 179 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Line 179 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
/* de-marshaling */ |
/* de-marshaling */ |
for (i = 0; i < io_arraySize(vars); i++) { |
for (i = 0; i < io_arraySize(vars); i++) { |
if (!zcpy) { |
if (!zcpy) { |
val = malloc(sizeof(ait_val_t)); | val = io_malloc(sizeof(ait_val_t)); |
if (!val) { |
if (!val) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 233 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Line 233 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Limit += AIT_LEN(val); |
Limit += AIT_LEN(val); |
|
|
if (!zcpy) { |
if (!zcpy) { |
val->val.buffer = malloc(AIT_LEN(val)); | val->val.buffer = io_malloc(AIT_LEN(val)); |
if (!val->val.buffer) { |
if (!val->val.buffer) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 393 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Line 393 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
/* de-marshaling */ |
/* de-marshaling */ |
for (i = 0; i < io_arraySize(vars); i++) { |
for (i = 0; i < io_arraySize(vars); i++) { |
if (!zcpy) { |
if (!zcpy) { |
val = malloc(sizeof(ait_val_t)); | val = io_malloc(sizeof(ait_val_t)); |
if (!val) { |
if (!val) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 438 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Line 438 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Limit += AIT_LEN(val); |
Limit += AIT_LEN(val); |
|
|
if (!zcpy) { |
if (!zcpy) { |
val->val.buffer = malloc(AIT_LEN(val)); | val->val.buffer = io_malloc(AIT_LEN(val)); |
if (!val->val.buffer) { |
if (!val->val.buffer) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 501 io_allocVars(int varnum)
|
Line 501 io_allocVars(int varnum)
|
inline ait_val_t * |
inline ait_val_t * |
io_getVars(array_t ** __restrict vars, int n) |
io_getVars(array_t ** __restrict vars, int n) |
{ |
{ |
|
register int i; |
ait_val_t *v; |
ait_val_t *v; |
|
|
if (!vars) |
if (!vars) |
return NULL; |
return NULL; |
|
|
if (!*vars) { |
if (!*vars) { |
if (!(*vars = io_arrayInit(n + 1))) | if (!(*vars = io_allocVars(n + 1))) |
return NULL; |
return NULL; |
} else { |
} else { |
if (n >= io_arraySize(*vars)) { | if (n >= (i = io_arraySize(*vars))) { |
if (io_arrayGrow(*vars, n + 1, 0)) |
if (io_arrayGrow(*vars, n + 1, 0)) |
return NULL; |
return NULL; |
if ((v = io_allocVar())) | for (; i < io_arraySize(*vars); i++) |
return NULL; | if (!io_arrayGet(*vars, i)) { |
else | if (!(v = io_allocVar())) |
io_arraySet(*vars, n, v); | return NULL; |
return v; | else |
| io_arraySet(*vars, n, v); |
| } |
} |
} |
} |
} |
|
|
Line 573 io_allocVar(void)
|
Line 576 io_allocVar(void)
|
{ |
{ |
ait_val_t *v = NULL; |
ait_val_t *v = NULL; |
|
|
v = malloc(sizeof(ait_val_t)); | v = io_malloc(sizeof(ait_val_t)); |
if (!v) { |
if (!v) { |
LOGERR; |
LOGERR; |
return NULL; |
return NULL; |
Line 595 io_freeVar(ait_val_t ** __restrict val)
|
Line 598 io_freeVar(ait_val_t ** __restrict val)
|
{ |
{ |
if (val && *val) { |
if (val && *val) { |
AIT_FREE_VAL(*val); |
AIT_FREE_VAL(*val); |
free(*val); | io_free(*val); |
*val = NULL; |
*val = NULL; |
} |
} |
} |
} |