Browse code

modules_k/rls: Some incorrect pkg_free() calls in DB only code

- Found and fixed by Hugh Waite @ Crocodile RCS

Peter Dunkley authored on 21/08/2012 14:21:54
Showing 1 changed files
... ...
@@ -798,6 +798,13 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
798 798
 	r_version = VAL_INT(&values[version_col]);
799 799
 	r_record_route = (char *)VAL_STRING(&values[rroute_col]);
800 800
 
801
+	if ( r_remote_cseq >= subs->remote_cseq)
802
+	{
803
+		LM_DBG("stored cseq= %d\n", r_remote_cseq);
804
+		rls_dbf.free_result(rls_db, result);
805
+		return(401); /*stale cseq code */
806
+	}
807
+
801 808
 	if(strlen(r_pres_uri) > 0)
802 809
 	{
803 810
 		subs->pres_uri.s =
... ...
@@ -805,7 +812,6 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
805 812
 		if(subs->pres_uri.s==NULL)
806 813
 		{
807 814
 			LM_ERR( "Out of Memory\n" );
808
- 			pkg_free(subs->pres_uri.s);
809 815
 			rls_dbf.free_result(rls_db, result);
810 816
 			return(-1);
811 817
 		}
... ...
@@ -814,13 +820,6 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
814 820
 		subs->pres_uri.len= strlen(r_pres_uri);
815 821
 	}
816 822
 
817
-	if ( r_remote_cseq >= subs->remote_cseq)
818
-	{
819
-		LM_DBG("stored cseq= %d\n", r_remote_cseq);
820
-		rls_dbf.free_result(rls_db, result);
821
-		return(401); /*stale cseq code */
822
-	}
823
-
824 823
 	if(strlen(r_record_route) > 0)
825 824
 	{
826 825
 		subs->record_route.s =
... ...
@@ -828,7 +827,6 @@ int get_dialog_subscribe_rlsdb(subs_t *subs)
828 827
 		if(subs->record_route.s==NULL)
829 828
 		{
830 829
 			LM_ERR( "Out of Memory\n" );
831
- 			pkg_free(subs->record_route.s);
832 830
 			rls_dbf.free_result(rls_db, result);
833 831
 			return(-1);
834 832
 		}