mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix memory handling error on MacOS
We are not allowed to free a string that we get back from the config APIs. So strdup it instead to be compatible with Linux in that respect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
be941e00b2
commit
1afe36840d
1 changed files with 1 additions and 1 deletions
2
macos.c
2
macos.c
|
@ -54,7 +54,7 @@ const void *subsurface_get_conf(char *name, pref_type_t type)
|
||||||
strpref = CFPreferencesCopyAppValue(CFSTR_VAR(name), SUBSURFACE_PREFERENCES);
|
strpref = CFPreferencesCopyAppValue(CFSTR_VAR(name), SUBSURFACE_PREFERENCES);
|
||||||
if (!strpref)
|
if (!strpref)
|
||||||
return NULL;
|
return NULL;
|
||||||
return CFStringGetCStringPtr(strpref, kCFStringEncodingMacRoman);
|
return strdup(CFStringGetCStringPtr(strpref, kCFStringEncodingMacRoman));
|
||||||
}
|
}
|
||||||
/* we shouldn't get here, but having this line makes the compiler happy */
|
/* we shouldn't get here, but having this line makes the compiler happy */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue