Browse code

registrar: free var in case of pv name error

Daniel-Constantin Mierla authored on 08/07/2017 07:38:13
Showing 1 changed files
... ...
@@ -288,8 +288,8 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in)
288 288
 {
289 289
 	str pn;
290 290
 	str pa;
291
-	regpv_name_t *rp;
292
-	regpv_profile_t *rpp;
291
+	regpv_name_t *rp = NULL;
292
+	regpv_profile_t *rpp = NULL;
293 293
 
294 294
 	if(sp==NULL || in==NULL || in->len<=0)
295 295
 		return -1;
... ...
@@ -414,6 +414,7 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in)
414 414
 	return 0;
415 415
 
416 416
 error:
417
+	if(rp) pkg_free(rp);
417 418
 	LM_ERR("unknown contact attr name in %.*s\n", in->len, in->s);
418 419
 	return -1;
419 420
 }