mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 01:00:36 +01:00
platform: preserve errno in nm_platform_sysctl_get_int_checked()
It's not clear whether free() changes errno. Be sure about it. https://bugzilla.gnome.org/show_bug.cgi?id=790726
This commit is contained in:
parent
8060c2a930
commit
653aab70ac
1 changed files with 3 additions and 0 deletions
|
|
@ -508,6 +508,7 @@ nm_platform_sysctl_get_int_checked (NMPlatform *self, const char *pathid, int di
|
|||
{
|
||||
char *value = NULL;
|
||||
gint32 ret;
|
||||
int errsv;
|
||||
|
||||
_CHECK_SELF (self, klass, fallback);
|
||||
|
||||
|
|
@ -522,7 +523,9 @@ nm_platform_sysctl_get_int_checked (NMPlatform *self, const char *pathid, int di
|
|||
}
|
||||
|
||||
ret = _nm_utils_ascii_str_to_int64 (value, base, min, max, fallback);
|
||||
errsv = errno;
|
||||
g_free (value);
|
||||
errno = errsv;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue