Project

General

Profile

Bug #102 ยป 0001-bug-102.patch

Gurvinder Singh, 03/02/2010 12:48 AM

View differences:

src/alert-unified-alert.c
if (file_ctx->fp == NULL) {
SCLogError(SC_ERR_FOPEN, "ERROR: failed to open %s: %s", filename,
strerror(errno));
ret = -1;
return TM_ECODE_FAILED;
}
file_ctx->flags = 0;
src/alert-unified-log.c
memset(aun, 0, sizeof(AlertUnifiedLogThread));
if (initdata == NULL) {
SCLogDebug("Error getting context for UnifiedLog. \"initdata\" argument NULL");
SCLogDebug("Error getting context for UnifiedLog. \"initdata\" argument NULL");
SCFree(aun);
return TM_ECODE_FAILED;
}
/** Use the Ouptut Context (file pointer and mutex) */
aun->file_ctx = (LogFileCtx*) initdata;
if (aun->file_ctx->fp == NULL) {
SCLogError (SC_ERR_OPENING_FILE, "Target file has not been opened, check"
" the write permission");
return TM_ECODE_FAILED;
}
/** Write Unified header */
int ret = AlertUnifiedLogWriteFileHeader(aun->file_ctx);
if (ret != 0) {
printf("Error: AlertUnifiedLogWriteFileHeader failed.\n");
SCLogError(SC_ERR_FWRITE, "AlertUnifiedLogWriteFileHeader failed.");
SCFree(aun);
return TM_ECODE_FAILED;
}
......
LogFileCtx* file_ctx=LogFileNewCtx();
if (file_ctx == NULL) {
printf("AlertUnifiedLogInitCtx: Couldn't create new file_ctx\n");
SCLogError(SC_ERR_MEM_ALLOC, "Couldn't create new file_ctx");
return NULL;
}
......
if (file_ctx->fp == NULL) {
SCLogError(SC_ERR_FOPEN, "ERROR: failed to open %s: %s", filename,
strerror(errno));
ret = -1;
return TM_ECODE_FAILED;
}
/** Write Unified header */
src/tm-modules.c
if(lf_ctx == NULL)
{
printf("LogFileCtxNew: Couldn't SCMalloc \n");
SCLogError(SC_ERR_MEM_ALLOC, "Couldn't SCMalloc");
return NULL;
}
memset(lf_ctx, 0, sizeof(LogFileCtx));
src/util-error.c
CASE_CODE (SC_ERR_B2G_CUDA_ERROR);
CASE_CODE (SC_ERR_INVALID_YAML_CONF_ENTRY);
CASE_CODE (SC_ERR_TMQ_ALREADY_REGISTERED);
CASE_CODE (SC_ERR_INITIALIZATION);
default:
return "UNKNOWN_ERROR";
}
    (1-1/1)