platform: use g_strdup() instead of strdup() in ethtool code
The string is freed with g_free(), it needs to be allocated with g_strdup(). In practice, the GLib allocator uses malloc() nowadays, but it is better to be consistent.
This commit is contained in:
@@ -153,7 +153,7 @@ ethtool_send_and_recv(struct nl_sock *sock,
|
||||
|
||||
out:
|
||||
if (nle < 0 && err_msg && *err_msg == NULL)
|
||||
*err_msg = strdup(nm_strerror(nle));
|
||||
*err_msg = g_strdup(nm_strerror(nle));
|
||||
|
||||
if (nle >= 0 && cb_result < 0)
|
||||
nle = cb_result;
|
||||
|
Reference in New Issue
Block a user