Fix potential prelude recourse leak during initialization

remotes/origin/master-1.1.x
Gerardo Iglesias Galvan 15 years ago committed by Victor Julien
parent db94f01831
commit 0f458495c7

@ -858,8 +858,14 @@ OutputCtx *AlertPreludeInitCtx(ConfNode *conf)
ctx->log_packet_header = 0; ctx->log_packet_header = 0;
output_ctx = SCMalloc(sizeof(OutputCtx)); output_ctx = SCMalloc(sizeof(OutputCtx));
if (output_ctx == NULL) if (output_ctx == NULL) {
return NULL; SCFree(ctx);
prelude_perror(ret, "Unable to allocate memory");
prelude_client_destroy(client, PRELUDE_CLIENT_EXIT_STATUS_SUCCESS);
SCReturnPtr(NULL, "AlertPreludeCtx");
}
output_ctx->data = ctx; output_ctx->data = ctx;
output_ctx->DeInit = AlertPreludeDeinitCtx; output_ctx->DeInit = AlertPreludeDeinitCtx;

Loading…
Cancel
Save