From cfab569484b18407fc117bb96634525cc76ea1f5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 6 Jan 2022 12:50:33 -0800 Subject: build: Replace use of g_memdup with util_memdup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- obexd/src/obex.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'obexd') diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 9f992ec18..3a68fd66c 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -40,6 +40,7 @@ #include "mimetype.h" #include "service.h" #include "transport.h" +#include "src/shared/util.h" typedef struct { uint8_t version; @@ -145,7 +146,7 @@ static void os_reset_session(struct obex_session *os) os->path = NULL; } if (os->apparam) { - g_free(os->apparam); + free(os->apparam); os->apparam = NULL; os->apparam_len = 0; } @@ -594,7 +595,7 @@ static void parse_apparam(struct obex_session *os, GObexPacket *req) if (!g_obex_header_get_bytes(hdr, &apparam, &len)) return; - os->apparam = g_memdup(apparam, len); + os->apparam = util_memdup(apparam, len); os->apparam_len = len; DBG("APPARAM"); } -- cgit v1.2.1