Browse code

textopsx: proper check for null value inside ki_modify_hf()

Daniel-Constantin Mierla authored on 08/12/2017 08:31:21
Showing 1 changed files
... ...
@@ -1183,7 +1183,7 @@ static int ki_modify_hf(sip_msg_t *msg, str *hexp, str *val,
1183 1183
 		p1 = NULL;
1184 1184
 		goto error;
1185 1185
 	}
1186
-	if(val && val->s>=0) {
1186
+	if(val && val->s!=0 && val->len>0) {
1187 1187
 		s2 = as_asciiz(val);
1188 1188
 		p2 = s2;
1189 1189
 		if(fixf(&p2, 2)!=0) {
... ...
@@ -1202,7 +1202,6 @@ static int ki_modify_hf(sip_msg_t *msg, str *hexp, str *val,
1202 1202
 	return ret;
1203 1203
 
1204 1204
 error:
1205
-	if(p2!=NULL) fixup_free_hname_str(&p2, 2);
1206 1205
 	if(p1!=NULL) fixup_free_hname_str(&p1, 1);
1207 1206
 	if(s2!=NULL) pkg_free(s2);
1208 1207
 	if(s1!=NULL) pkg_free(s1);