f913b189a6a1fd35f8fdec62921db445f91945b6
[feed/telephony.git] /
1 commit 30f9a094c1c60e0d68e4ea189f48ecb47aebb485
2 Author: arny <arnysch@gmx.net>
3 Date: Thu May 2 20:07:28 2019 +0200
4
5 Use ast_malloc and ast_free instead of malloc and free
6 in order to get rid of build errors with asterisk16 in OpenWrt
7
8 Signed-off-by: arny <arnysch@gmx.net>
9
10 diff --git a/src/channels/chan_lantiq.c b/src/channels/chan_lantiq.c
11 index a8fc869..90002ab 100644
12 --- a/src/channels/chan_lantiq.c
13 +++ b/src/channels/chan_lantiq.c
14 @@ -563,9 +563,9 @@ lantiq_dev_binary_buffer_create(const char *path, uint8_t **ppBuf, uint32_t *pBu
15 goto on_exit;
16 }
17
18 - *ppBuf = malloc(file_stat.st_size);
19 + *ppBuf = ast_malloc(file_stat.st_size);
20 if (*ppBuf == NULL) {
21 - ast_log(LOG_ERROR, "binary file %s memory allocation failed\n", path);
22 + // Message already logged by ast_malloc
23 goto on_exit;
24 }
25
26 @@ -583,7 +583,7 @@ on_exit:
27 fclose(fd);
28
29 if (*ppBuf != NULL && status)
30 - free(*ppBuf);
31 + ast_free(*ppBuf);
32
33 return status;
34 }
35 @@ -609,7 +609,7 @@ static int32_t lantiq_dev_firmware_download(int32_t fd, const char *path)
36 }
37
38 if (firmware != NULL)
39 - free(firmware);
40 + ast_free(firmware);
41
42 return 0;
43 }