Browse Source

Fixed memory leak. Fixes #3.

woollybah 10 years ago
parent
commit
17db4e5e71
1 changed files with 3 additions and 1 deletions
  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 ){