[gssdp] net-posix: Replace g_memdup if available
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gssdp] net-posix: Replace g_memdup if available
- Date: Fri, 21 May 2021 16:27:06 +0000 (UTC)
commit ae442a2fd745c7cca7424a8b357789b6e6dbc253
Author: Jens Georg <mail jensge org>
Date: Fri May 21 18:26:11 2021 +0200
net-posix: Replace g_memdup if available
libgssdp/gssdp-net-posix.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/libgssdp/gssdp-net-posix.c b/libgssdp/gssdp-net-posix.c
index 5ca8f7c..eb4b238 100644
--- a/libgssdp/gssdp-net-posix.c
+++ b/libgssdp/gssdp-net-posix.c
@@ -215,7 +215,11 @@ gssdp_net_mac_lookup (GSSDPNetworkDevice *device, const char *ip_address)
} else if (rtattr->rta_type == NDA_LLADDR) {
g_clear_pointer (&data, g_free);
data_length = RTA_PAYLOAD (rtattr);
+#if GLIB_CHECK_VERSION(2, 68, 0)
+ data = g_memdup2 (RTA_DATA (rtattr), data_length);
+#else
data = g_memdup (RTA_DATA (rtattr), data_length);
+#endif
}
rtattr = RTA_NEXT (rtattr, rtattr_len);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]