|
|
|
@ -246,7 +246,7 @@ PHPDBG_API phpdbg_input_t *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */ |
|
|
|
} else cmd = buffered; |
|
|
|
|
|
|
|
/* allocate and sanitize buffer */ |
|
|
|
buffer = (phpdbg_input_t*) emalloc(sizeof(phpdbg_input_t)); |
|
|
|
buffer = (phpdbg_input_t*) ecalloc(1, sizeof(phpdbg_input_t)); |
|
|
|
if (!buffer) { |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
@ -283,25 +283,31 @@ PHPDBG_API phpdbg_input_t *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */ |
|
|
|
return NULL; |
|
|
|
} /* }}} */ |
|
|
|
|
|
|
|
PHPDBG_API void phpdbg_destroy_input(phpdbg_input_t **input TSRMLS_DC) /*{{{ */ |
|
|
|
PHPDBG_API void phpdbg_destroy_argv(phpdbg_input_t **argv, int argc TSRMLS_DC) /* {{{ */ |
|
|
|
{ |
|
|
|
if (*input) { |
|
|
|
if ((*input)->string) { |
|
|
|
efree((*input)->string); |
|
|
|
} |
|
|
|
|
|
|
|
if ((*input)->argc > 0) { |
|
|
|
if (argv) { |
|
|
|
if (argc) { |
|
|
|
int arg; |
|
|
|
for (arg=0; arg<(*input)->argc; arg++) { |
|
|
|
for (arg=0; arg<argc; arg++) { |
|
|
|
phpdbg_destroy_input( |
|
|
|
&(*input)->argv[arg] TSRMLS_CC); |
|
|
|
&argv[arg] TSRMLS_CC); |
|
|
|
} |
|
|
|
} |
|
|
|
efree(argv); |
|
|
|
} |
|
|
|
|
|
|
|
} /* }}} */ |
|
|
|
|
|
|
|
if ((*input)->argv) { |
|
|
|
efree((*input)->argv); |
|
|
|
PHPDBG_API void phpdbg_destroy_input(phpdbg_input_t **input TSRMLS_DC) /*{{{ */ |
|
|
|
{ |
|
|
|
if (*input) { |
|
|
|
if ((*input)->string) { |
|
|
|
efree((*input)->string); |
|
|
|
} |
|
|
|
|
|
|
|
phpdbg_destroy_argv( |
|
|
|
(*input)->argv, (*input)->argc TSRMLS_CC); |
|
|
|
|
|
|
|
efree(*input); |
|
|
|
} |
|
|
|
} /* }}} */ |
|
|
|
|