summaryrefslogtreecommitdiff
path: root/webhook_exec.h
diff options
context:
space:
mode:
Diffstat (limited to 'webhook_exec.h')
-rw-r--r--webhook_exec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/webhook_exec.h b/webhook_exec.h
index 445ed88..48b9a4b 100644
--- a/webhook_exec.h
+++ b/webhook_exec.h
@@ -23,6 +23,11 @@ char *webhook_exec( webhooks_data_t *wh_data, char *wh_endpoint ){
}
wh_data->wh_response = NULL;
wh_data->wh_output = (char*)calloc( (size_t)MAX_WEBHOOK_OUTPUT_LENGTH, sizeof(char) );
+ if ( wh_data->wh_output == NULL ){
+ wh_data->wh_command = NULL;
+ wh_data->wh_output = NULL;
+ return "Error: failed to allocate memory for command output";
+ }
FILE *wh_proc = popen( wh_data->wh_command->valuestring, "r" );
if ( wh_proc == NULL ){
free( wh_data->wh_output );