[sr-dev] git:master: core: In case of OOM, prevent crash

Marius Zbihlei marius.zbihlei at 1and1.ro
Fri Jan 14 17:04:46 CET 2011


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

Author: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei at 1and1.ro>
Date:   Fri Jan 14 17:30:32 2011 +0200

core: In case of OOM, prevent crash

---

 ut.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/ut.c b/ut.c
index 275381c..b011fda 100644
--- a/ut.c
+++ b/ut.c
@@ -243,6 +243,7 @@ char* get_abs_pathname(str* base, str* file)
 		 * copy and use it as it is */
 		if ((res = pkg_malloc(file->len+1)) == NULL) {
 			ERR("get_abs_pathname: No memory left (pkg_malloc failed)\n");
+			return NULL;
 		}
 		memcpy(res, file->s, file->len);
 		res[file->len]=0;




More information about the sr-dev mailing list