mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 06:33:41 +02:00
gio: Use g_memdup2() instead of g_memdup() in obvious places
Convert all the call sites which use `g_memdup()`’s length argument trivially (for example, by passing a `sizeof()`), so that they use `g_memdup2()` instead. In almost all of these cases the use of `g_memdup()` would not have caused problems, but it will soon be deprecated, so best port away from it. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2319
This commit is contained in:
@@ -4016,7 +4016,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
|
||||
/* Don't waste memory by copying padding - remember to update this
|
||||
* when changing struct _GDBusInterfaceVTable in gdbusconnection.h
|
||||
*/
|
||||
return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
|
||||
return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4033,7 +4033,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
|
||||
/* Don't waste memory by copying padding - remember to update this
|
||||
* when changing struct _GDBusSubtreeVTable in gdbusconnection.h
|
||||
*/
|
||||
return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
|
||||
return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user