diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-01-06 12:50:33 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-01-06 12:58:39 -0800 |
commit | cfab569484b18407fc117bb96634525cc76ea1f5 (patch) | |
tree | 754ec37148cc95958f1657e25768ad69565ebf23 /plugins/neard.c | |
parent | 9f09e69ecb077082301dafb745856e1f3731aaa7 (diff) | |
download | bluez-cfab569484b18407fc117bb96634525cc76ea1f5.tar.gz |
build: Replace use of g_memdup with util_memdup
This replaces the uses of g_memdup with util_memdup since the former has
been deprecated:
warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead
[-Wdeprecated-declarations]
g_memdup2 requires bumping glib version which would likely have its
own problems thus why util_memdup was introduced.
Diffstat (limited to 'plugins/neard.c')
-rw-r--r-- | plugins/neard.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/neard.c b/plugins/neard.c index e07b51106..a75527148 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -30,6 +30,7 @@ #include "src/eir.h" #include "src/agent.h" #include "src/btd.h" +#include "src/shared/util.h" #define NEARD_NAME "org.neard" #define NEARD_PATH "/" @@ -71,7 +72,7 @@ static void free_oob_params(struct oob_params *params) g_free(params->name); g_free(params->hash); g_free(params->randomizer); - g_free(params->pin); + free(params->pin); } static DBusMessage *error_reply(DBusMessage *msg, int error) @@ -407,10 +408,10 @@ static int process_nokia_long (void *data, size_t size, uint8_t marker, remote->name = g_strndup((char *)n->name, n->name_len); if (marker == 0x01) { - remote->pin = g_memdup(n->authentication, 4); + remote->pin = util_memdup(n->authentication, 4); remote->pin_len = 4; } else if (marker == 0x02) { - remote->pin = g_memdup(n->authentication, 16); + remote->pin = util_memdup(n->authentication, 16); remote->pin_len = 16; } @@ -439,7 +440,7 @@ static int process_nokia_short (void *data, size_t size, if (n->name_len > 0) remote->name = g_strndup((char *)n->name, n->name_len); - remote->pin = g_memdup(n->authentication, 4); + remote->pin = util_memdup(n->authentication, 4); remote->pin_len = 4; return 0; |