[sr-dev] git:master: exec: free local variable if there is no more memory in next attempt

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 21 22:00:31 CEST 2014


Module: sip-router
Branch: master
Commit: 314ea152c51cd8d4b46a49c05a3fed564c81c0ea
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=314ea152c51cd8d4b46a49c05a3fed564c81c0ea

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Apr 21 21:53:27 2014 +0200

exec: free local variable if there is no more memory in next attempt

---

 modules/exec/exec_hf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/exec/exec_hf.c b/modules/exec/exec_hf.c
index 37eaf27..3bc761b 100644
--- a/modules/exec/exec_hf.c
+++ b/modules/exec/exec_hf.c
@@ -363,6 +363,7 @@ environment_t *replace_env(struct hf_wrapper *list)
 	new_env=pkg_malloc((var_cnt+1)*sizeof(char *));
 	if (!new_env) {
 		LM_ERR("no pkg mem\n");
+		pkg_free(backup_env);
 		return 0;
 	}
 	/* put all var pointers into new environment */




More information about the sr-dev mailing list