mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0022960: Memory leak in Xw_get_env.cxx
This commit is contained in:
parent
7339789994
commit
88c36d5906
@ -1960,11 +1960,4 @@ extern "C" {
|
||||
#endif
|
||||
);
|
||||
|
||||
XW_STATUS Xw_put_env(
|
||||
#ifdef XW_PROTOTYPE
|
||||
char* symbol,
|
||||
char* value
|
||||
#endif
|
||||
);
|
||||
|
||||
#endif /*XW_CEXTERN*/
|
||||
|
@ -58,29 +58,3 @@ if( Xw_get_trace() > 1 ) {
|
||||
|
||||
return (XW_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef XW_PROTOTYPE
|
||||
XW_STATUS Xw_put_env (char* symbol,char* value)
|
||||
#else
|
||||
XW_STATUS Xw_put_env (symbol,value)
|
||||
char *symbol,*value ;
|
||||
#endif /*XW_PROTOTYPE*/
|
||||
{
|
||||
char *string ;
|
||||
|
||||
if( !strlen(symbol) ) return (XW_ERROR) ;
|
||||
|
||||
string = (char*) malloc(strlen(symbol) + strlen(value) + 4) ;
|
||||
|
||||
sprintf(string,"%s=%s",symbol,value) ;
|
||||
|
||||
if( putenv(string) ) return (XW_ERROR) ;
|
||||
|
||||
#ifdef TRACE_PUT_ENV
|
||||
if( Xw_get_trace() > 1 ) {
|
||||
printf (" Xw_put_env('%s','%s')\n",symbol,value) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (XW_SUCCESS);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user