ソースを参照

uac: check if local requests are dropped and free the param

(cherry picked from commit 00aac8d48370fac356eecff535835d918c631cc5)
Daniel-Constantin Mierla 1 年間 前
コミット
46c8e1a5b0
2 ファイル変更16 行追加0 行削除
  1. 7 0
      src/modules/uac/uac_reg.c
  2. 9 0
      src/modules/uac/uac_send.c

+ 7 - 0
src/modules/uac/uac_reg.c

@@ -974,6 +974,10 @@ void uac_reg_tm_callback(struct cell *t, int type, struct tmcb_params *ps)
 					ri->l_uuid.len, ri->l_uuid.s);
 			goto error;
 		}
+		if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) {
+			shm_free(uuid);
+			*ps->param = NULL;
+		}
 
 		ri->flags |= UAC_REG_AUTHSENT;
 		lock_release(ri->lock);
@@ -1130,6 +1134,9 @@ int uac_reg_send(reg_uac_t *reg, time_t tn)
 		reg->flags &= ~UAC_REG_ONGOING;
 		return -1;
 	}
+	if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) {
+		shm_free(uuid);
+	}
 	return 0;
 }
 

+ 9 - 0
src/modules/uac/uac_send.c

@@ -794,6 +794,11 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps)
 		LM_ERR("failed to send request with authentication\n");
 		goto error;
 	}
+	if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) {
+		shm_free(tp);
+		*ps->param = NULL;
+		tp = NULL;
+	}
 
 	if(tp->evroute != 0) {
 		return;
@@ -871,6 +876,10 @@ int uac_req_send(void)
 			shm_free(tp);
 		return -1;
 	}
+	if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) {
+		if(tp != NULL)
+			shm_free(tp);
+	}
 	return 1;
 }