mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 04:00:19 +02:00
(scm_putenv): Free temporary ptr in mingw unset.
This commit is contained in:
parent
7e88be2ee8
commit
dd65e90f3b
1 changed files with 2 additions and 1 deletions
|
@ -1157,7 +1157,7 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
|
||||||
"The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_putenv
|
#define FUNC_NAME s_scm_putenv
|
||||||
{
|
{
|
||||||
int rv;
|
int rv, e;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
SCM_VALIDATE_STRING (1, str);
|
SCM_VALIDATE_STRING (1, str);
|
||||||
|
@ -1177,6 +1177,7 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
|
||||||
ptr[SCM_STRING_LENGTH (str)] = '=';
|
ptr[SCM_STRING_LENGTH (str)] = '=';
|
||||||
ptr[SCM_STRING_LENGTH (str) + 1] = 0;
|
ptr[SCM_STRING_LENGTH (str) + 1] = 0;
|
||||||
rv = putenv (ptr);
|
rv = putenv (ptr);
|
||||||
|
e = errno; free (ptr); errno = e;
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue