From 08a96465f08d229b40a8a43b4ec7a4f74502f9ef Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 4 May 2019 22:32:17 +0200 Subject: [PATCH] asterisk-16.x-chan-lantiq: add compile fix Patch from upstream pull request (https://github.com/kochstefan/asterisk_channel_lantiq/pull/3). Signed-off-by: Sebastian Kemper --- net/asterisk-16.x-chan-lantiq/Makefile | 2 +- ...-ast_free-instead-of-malloc-and-free.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 net/asterisk-16.x-chan-lantiq/patches/01-Use-ast_malloc-and-ast_free-instead-of-malloc-and-free.patch diff --git a/net/asterisk-16.x-chan-lantiq/Makefile b/net/asterisk-16.x-chan-lantiq/Makefile index 2aa4fca..5884673 100644 --- a/net/asterisk-16.x-chan-lantiq/Makefile +++ b/net/asterisk-16.x-chan-lantiq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=asterisk16-chan-lantiq PKG_VERSION:=20180215 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/kochstefan/asterisk_channel_lantiq.git diff --git a/net/asterisk-16.x-chan-lantiq/patches/01-Use-ast_malloc-and-ast_free-instead-of-malloc-and-free.patch b/net/asterisk-16.x-chan-lantiq/patches/01-Use-ast_malloc-and-ast_free-instead-of-malloc-and-free.patch new file mode 100644 index 0000000..f913b18 --- /dev/null +++ b/net/asterisk-16.x-chan-lantiq/patches/01-Use-ast_malloc-and-ast_free-instead-of-malloc-and-free.patch @@ -0,0 +1,43 @@ +commit 30f9a094c1c60e0d68e4ea189f48ecb47aebb485 +Author: arny +Date: Thu May 2 20:07:28 2019 +0200 + + Use ast_malloc and ast_free instead of malloc and free + in order to get rid of build errors with asterisk16 in OpenWrt + + Signed-off-by: arny + +diff --git a/src/channels/chan_lantiq.c b/src/channels/chan_lantiq.c +index a8fc869..90002ab 100644 +--- a/src/channels/chan_lantiq.c ++++ b/src/channels/chan_lantiq.c +@@ -563,9 +563,9 @@ lantiq_dev_binary_buffer_create(const char *path, uint8_t **ppBuf, uint32_t *pBu + goto on_exit; + } + +- *ppBuf = malloc(file_stat.st_size); ++ *ppBuf = ast_malloc(file_stat.st_size); + if (*ppBuf == NULL) { +- ast_log(LOG_ERROR, "binary file %s memory allocation failed\n", path); ++ // Message already logged by ast_malloc + goto on_exit; + } + +@@ -583,7 +583,7 @@ on_exit: + fclose(fd); + + if (*ppBuf != NULL && status) +- free(*ppBuf); ++ ast_free(*ppBuf); + + return status; + } +@@ -609,7 +609,7 @@ static int32_t lantiq_dev_firmware_download(int32_t fd, const char *path) + } + + if (firmware != NULL) +- free(firmware); ++ ast_free(firmware); + + return 0; + } -- 2.30.2