iprep: improve error checking of path handling

pull/3559/head
Victor Julien 7 years ago
parent 0b3220a0df
commit 5740c79b93

@ -580,8 +580,6 @@ int SRepInit(DetectEngineCtx *de_ctx)
{ {
ConfNode *files; ConfNode *files;
ConfNode *file = NULL; ConfNode *file = NULL;
int r = 0;
char *sfile = NULL;
const char *filename = NULL; const char *filename = NULL;
int init = 0; int init = 0;
int i = 0; int i = 0;
@ -633,13 +631,14 @@ int SRepInit(DetectEngineCtx *de_ctx)
de_ctx->srep_version = SRepIncrVersion(); de_ctx->srep_version = SRepIncrVersion();
SCLogDebug("Reputation version %u", de_ctx->srep_version); SCLogDebug("Reputation version %u", de_ctx->srep_version);
/* ok, let's load signature files from the general config */ /* ok, let's load reputation files from the general config */
if (files != NULL) { if (files != NULL) {
TAILQ_FOREACH(file, &files->head, next) { TAILQ_FOREACH(file, &files->head, next) {
sfile = SRepCompleteFilePath(file->val); char *sfile = SRepCompleteFilePath(file->val);
if (sfile) {
SCLogInfo("Loading reputation file: %s", sfile); SCLogInfo("Loading reputation file: %s", sfile);
r = SRepLoadFile(cidr_ctx, sfile); int r = SRepLoadFile(cidr_ctx, sfile);
if (r < 0){ if (r < 0){
if (de_ctx->failure_fatal == 1) { if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -648,6 +647,7 @@ int SRepInit(DetectEngineCtx *de_ctx)
SCFree(sfile); SCFree(sfile);
} }
} }
}
/* Set effective rep version. /* Set effective rep version.
* On live reload we will handle this after de_ctx has been swapped */ * On live reload we will handle this after de_ctx has been swapped */

Loading…
Cancel
Save