Module: kamailio Branch: master Commit: 3a81cd7b2dc0b9a5c540a54c34413360d6d076b9 URL: https://github.com/kamailio/kamailio/commit/3a81cd7b2dc0b9a5c540a54c34413360...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2017-01-12T16:22:31+01:00
xhttp_pi: fix compiler warning
xhttp_pi_fnc.c: In function 'ph_init_cmds': xhttp_pi_fnc.c:1922:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if(doc)xmlFree(doc);doc=NULL; ^~ xhttp_pi_fnc.c:1922:23: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if(doc)xmlFree(doc);doc=NULL; ^~~ xhttp_pi_fnc.c:1942:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if(doc)xmlFree(doc);doc=NULL; ^~ xhttp_pi_fnc.c:1942:23: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if(doc)xmlFree(doc);doc=NULL; ^~~ xhttp_pi_fnc.c:1950:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if(doc)xmlFree(doc);doc=NULL; ^~ xhttp_pi_fnc.c:1950:22: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if(doc)xmlFree(doc);doc=NULL; ^~~ xhttp_pi_fnc.c:1961:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if(doc)xmlFree(doc);doc=NULL; ^~ xhttp_pi_fnc.c:1961:22: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if(doc)xmlFree(doc);doc=NULL; ^~~
---
Modified: src/modules/xhttp_pi/xhttp_pi_fnc.c
---
Diff: https://github.com/kamailio/kamailio/commit/3a81cd7b2dc0b9a5c540a54c34413360... Patch: https://github.com/kamailio/kamailio/commit/3a81cd7b2dc0b9a5c540a54c34413360...
---
diff --git a/src/modules/xhttp_pi/xhttp_pi_fnc.c b/src/modules/xhttp_pi/xhttp_pi_fnc.c index fdc3b09..e87beef 100644 --- a/src/modules/xhttp_pi/xhttp_pi_fnc.c +++ b/src/modules/xhttp_pi/xhttp_pi_fnc.c @@ -1919,7 +1919,10 @@ int ph_init_cmds(ph_framework_t **framework_data, const char* filename) if(ph_getMods(_framework_data, framework_node)!=0) goto xml_error;
- if(doc)xmlFree(doc);doc=NULL; + if(doc) { + xmlFree(doc); + doc=NULL; + } *framework_data = _framework_data; }else{ /* This is a reload */ _ph_db_tables = _framework_data->ph_db_tables; @@ -1939,7 +1942,10 @@ int ph_init_cmds(ph_framework_t **framework_data, const char* filename) if(ph_getMods(_framework_data, framework_node)!=0) goto xml_reload_error;
- if(doc)xmlFree(doc);doc=NULL; + if(doc){ + xmlFree(doc); + doc=NULL; + } *framework_data = _framework_data;
} @@ -1947,7 +1953,10 @@ int ph_init_cmds(ph_framework_t **framework_data, const char* filename) xml_error: /* FIXME: free thw whole structure */ if(_framework_data){shm_free(_framework_data);} - if(doc)xmlFree(doc);doc=NULL; + if(doc){ + xmlFree(doc); + doc=NULL; + } return -1; xml_reload_error: ph_freeDbTables(&_framework_data->ph_db_tables, @@ -1958,7 +1967,10 @@ int ph_init_cmds(ph_framework_t **framework_data, const char* filename) _framework_data->ph_db_tables_size = _ph_db_tables_size; _framework_data->ph_modules = _ph_modules; _framework_data->ph_modules_size = _ph_modules_size; - if(doc)xmlFree(doc);doc=NULL; + if(doc) { + xmlFree(doc); + doc=NULL; + } return -1; }