Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.6.0
-
Linux
Description
There is a segfault when an error ocurrs in creating conf.
To reproduce the bug:
- Install axis2c trunk, and compile samples
- go to AXIS2C_HOME/lib and remove or move one of the libraries (cd $AXIS2C_HOME/lib &&sudo mv libaxis2_http_receiver.so.0.7.0 libaxis2_http_receiver.so.0.7.0.1)
- execute one of the samples (i.e. echo) it will segfault.
Altough it is an error not beeing able to find an so, it should close gracefully, I think that this segfault may arise under other circumstances which cause conf building to fail...
Examining the issue with valgrind it seems that there is a double freeing of dep_engine.
dep_engine has a reference to conf and conf has a reference to dep_engine, and when it fails on creating conf, it deletes the conf (dep_engine.c:968) and when it exits the function tries to delete dep_engine again, which causes the segfault.
The proposed solution is to set the dep_engine ptr from conf to NULL before deleting the conf.
The proposed patch avoids the segfault, and doesn't leak memory in normal or error cases, please let me know if it is OK.