mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-12 03:58:34 +01:00
Fix segmentation fault in case the backup tree is not initialized
This commit is contained in:
parent
ef0acdc329
commit
b83308461b
1 changed files with 4 additions and 2 deletions
|
|
@ -172,7 +172,8 @@ void bkp_tree_clean(void)
|
|||
void bkp_session_save()
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
if (!bkp_tree)
|
||||
return;
|
||||
pthread_mutex_lock(&mutex_backup_session);
|
||||
fp = fopen(CWMP_BKP_FILE, "w");
|
||||
mxmlSaveFile(bkp_tree, fp, MXML_NO_CALLBACK);
|
||||
|
|
@ -200,7 +201,8 @@ mxml_node_t *bkp_session_node_found(mxml_node_t *tree, char *name, struct search
|
|||
mxml_node_t *b = tree, *c, *d;
|
||||
struct search_keywords;
|
||||
int i = 0;
|
||||
|
||||
if (!tree)
|
||||
return NULL;
|
||||
b = mxmlFindElement(b, b, name, NULL, NULL, MXML_DESCEND_FIRST);
|
||||
while (b) {
|
||||
if (b && b->child) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue