[sr-dev] git:master:6e3e86c2: htable: better handling of unsupported matching operator

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 17 11:49:17 CEST 2018


Module: kamailio
Branch: master
Commit: 6e3e86c2bae81232f73b391d0cd47b5e4415a0b8
URL: https://github.com/kamailio/kamailio/commit/6e3e86c2bae81232f73b391d0cd47b5e4415a0b8

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-09-17T11:48:37+02:00

htable: better handling of unsupported matching operator

---

Modified: src/modules/htable/ht_api.c

---

Diff:  https://github.com/kamailio/kamailio/commit/6e3e86c2bae81232f73b391d0cd47b5e4415a0b8.diff
Patch: https://github.com/kamailio/kamailio/commit/6e3e86c2bae81232f73b391d0cd47b5e4415a0b8.patch

---

diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 1c82e9c7ea..f129c5d48f 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -1398,7 +1398,9 @@ int ht_has_cell_op_str(str *sre, ht_t *ht, int mode, int op)
 						}
 					break;
 					default:
-						goto notmatched;
+						ht_slot_unlock(ht, i);
+						LM_ERR("unsupported matching operator: %d\n", op);
+						return -1;
 				}
 			}
 			it = it->next;
@@ -1416,13 +1418,6 @@ int ht_has_cell_op_str(str *sre, ht_t *ht, int mode, int op)
 		regfree(&re);
 	}
 	return 1;
-
-notmatched:
-	ht_slot_unlock(ht, i);
-	if(op==HT_RM_OP_RE) {
-		regfree(&re);
-	}
-	return -1;
 }
 
 int ht_reset_content(ht_t *ht)




More information about the sr-dev mailing list