[sr-dev] git:master:e656ed74: core: explicitly cast void* to char* in shm_char_dup()

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 8 09:38:57 CET 2020


Module: kamailio
Branch: master
Commit: e656ed7400e735ec867875d20b9ae117af7001b5
URL: https://github.com/kamailio/kamailio/commit/e656ed7400e735ec867875d20b9ae117af7001b5

Author: James Aimonetti <james.aimonetti at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-01-08T09:37:00+01:00

core: explicitly cast void* to char* in shm_char_dup()

- fix gcc 9.2 warning
- GH #2191

---

Modified: src/core/ut.h

---

Diff:  https://github.com/kamailio/kamailio/commit/e656ed7400e735ec867875d20b9ae117af7001b5.diff
Patch: https://github.com/kamailio/kamailio/commit/e656ed7400e735ec867875d20b9ae117af7001b5.patch

---

diff --git a/src/core/ut.h b/src/core/ut.h
index a841449164..56c1f9e157 100644
--- a/src/core/ut.h
+++ b/src/core/ut.h
@@ -808,7 +808,7 @@ static inline char* shm_char_dup(const char *src)
 	}
 
 	len = strlen(src) + 1;
-	rval = shm_malloc(len);
+	rval = (char*)shm_malloc(len);
 	if (!rval) {
 		SHM_MEM_ERROR;
 		return NULL;




More information about the sr-dev mailing list