Procházet zdrojové kódy

modules_k/rls: Fixed memory leak in rls under some error conditions

- Found and fixed by Hugh Waite @ Crocodile RCS
Peter Dunkley před 13 roky
rodič
revize
de8b241ea3
1 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 5 2
      modules_k/rls/subscribe.c

+ 5 - 2
modules_k/rls/subscribe.c

@@ -657,7 +657,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 					LM_ERR("while sending reply\n");
 					LM_ERR("while sending reply\n");
 					goto error;
 					goto error;
 				}
 				}
-				return 0;
+				ret = 0;
+				goto stop;
 			}
 			}
 
 
 			/* if correct reply with 200 OK */
 			/* if correct reply with 200 OK */
@@ -705,7 +706,8 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 					LM_ERR("while sending reply\n");
 					LM_ERR("while sending reply\n");
 					goto error;
 					goto error;
 				}
 				}
-				return 0;
+				ret = 0;
+				goto stop;
 			}
 			}
 		}	
 		}	
 		if(rls_get_service_list(&subs.pres_uri, &subs.watcher_user,
 		if(rls_get_service_list(&subs.pres_uri, &subs.watcher_user,
@@ -745,6 +747,7 @@ int rls_handle_subscribe(struct sip_msg* msg, str watcher_user, str watcher_doma
 
 
 done:
 done:
 	ret = 1;
 	ret = 1;
+stop:
 forpresence:
 forpresence:
 	if(contact!=NULL)
 	if(contact!=NULL)
 	{	
 	{