diff --git a/src/modules/rls/resource_notify.c b/src/modules/rls/resource_notify.c index d42c29666ba..0f31e7c877b 100644 --- a/src/modules/rls/resource_notify.c +++ b/src/modules/rls/resource_notify.c @@ -183,6 +183,7 @@ static void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, subs_t* dialog= NULL; int len_est = 0; int resource_added = 0; /* Flag to indicate that we have added at least one resource */ + int ok = 0; /* generate the boundary string */ boundary_string= generate_string(BOUNDARY_STRING_LEN); @@ -430,6 +431,7 @@ static void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, } done: + ok = 1; if (dbmode == RLS_DB_ONLY && rls_dbf.end_transaction) { if (rls_dbf.end_transaction(rls_db) < 0) @@ -454,6 +456,11 @@ static void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, LM_ERR("in abort_transaction\n"); } + if(ok==0) { + if(rlmi_doc!=NULL) { + xmlFreeDoc(rlmi_doc); + } + } return; }