_tmpnam_r(NULL) uses malloc instead of returning a static buf and as such represents a major memory leak in to most code wich does not expect to have to free the pointer _tmpnam_r returns. -- Stuart