mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fixes a bug with an unitialized variable.
new_debug_log was unitialized during an error code path. Fixed this by explicit initializing it to NULL and fixing the order of the error labels. They now present the correct (reverse) order of the goto statements.
This commit is contained in:
parent
3a048ee2db
commit
43e3ff91e8
@ -52,7 +52,7 @@ std::pair<msc_file_handler *, FILE *> SharedFiles::add_new_handler(
|
||||
int shm_id;
|
||||
int ret;
|
||||
key_t mem_key_structure;
|
||||
msc_file_handler_t *new_debug_log;
|
||||
msc_file_handler_t *new_debug_log = NULL;
|
||||
struct shmid_ds shared_mem_info;
|
||||
FILE *fp;
|
||||
bool toBeCreated = true;
|
||||
@ -113,10 +113,10 @@ std::pair<msc_file_handler *, FILE *> SharedFiles::add_new_handler(
|
||||
std::make_pair(new_debug_log, fp)));
|
||||
|
||||
return std::make_pair(new_debug_log, fp);
|
||||
err_shmget1:
|
||||
err_shmctl1:
|
||||
err_shmat1:
|
||||
shmdt(new_debug_log);
|
||||
err_shmctl1:
|
||||
err_shmget1:
|
||||
err_mem_key:
|
||||
fclose(fp);
|
||||
err_fh:
|
||||
|
Loading…
x
Reference in New Issue
Block a user