Explorar o código

Fixed memory leak. Fixes #3.

woollybah %!s(int64=10) %!d(string=hai) anos
pai
achega
17db4e5e71
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      stdc.mod/stdc.c

+ 3 - 1
stdc.mod/stdc.c

@@ -217,7 +217,9 @@ int putenv_( BBString *str ){
 	char *t=bbTmpUTF8String( str );
 	char *p=(char*)malloc( strlen(t)+1 );
 	strcpy( p,t );
-	return putenv( p );
+	int res = putenv( p );
+	free(p);
+	return res;
 }
 
 BBString *getenv_( BBString *str ){