Browse code

ims_diameter_server: removed goto label used in single place

Daniel-Constantin Mierla authored on 22/04/2021 07:36:31
Showing 1 changed files
... ...
@@ -286,7 +286,10 @@ int ki_diameter_request(struct sip_msg * msg, str* s_peer, int i_appid, int i_co
286 286
                 session = 0;
287 287
         }
288 288
 
289
-	if (!req) goto error1;
289
+	if (!req) {
290
+		LM_ERR("Error occurred trying to send request\n");
291
+		return -1;
292
+	}
290 293
 
291 294
 	if (!addAVPsfromJSON(req, s_message)) {
292 295
 		LM_ERR("Failed to parse JSON Request\n");
... ...
@@ -325,12 +328,6 @@ int ki_diameter_request(struct sip_msg * msg, str* s_peer, int i_appid, int i_co
325 328
 			}
326 329
 		}
327 330
 	}
328
-error1:
329
-	//Only free UAR IFF it has not been passed to CDP
330
-	if (req) cdpb.AAAFreeMessage(&req);
331
-	LM_ERR("Error occurred trying to send request\n");
332
-	return -1;
333
-
334 331
 }
335 332
 
336 333
 int diameter_request(struct sip_msg * msg, char* peer, char* appid, char* commandcode, char* message, int async) {