- Fix Coverity CID 9
Check for error in fcntl, as we depend on close-on-exec, F_SETFD will result in -1 in case of error (stored in errno). To not have a follow-up warning about not freeing filename, move up. This commit was SVN r21171.
Этот коммит содержится в:
родитель
cd565923d3
Коммит
b8bb7865bc
@ -629,15 +629,18 @@ static int open_file(int i)
|
||||
return OPAL_ERR_IN_ERRNO;
|
||||
}
|
||||
|
||||
free(filename);
|
||||
|
||||
/* Make the file be close-on-exec to prevent child inheritance
|
||||
* problems */
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/* TODO: Need to find out the equivalent in windows */
|
||||
fcntl(info[i].ldi_fd, F_SETFD, 1);
|
||||
if (-1 == fcntl(info[i].ldi_fd, F_SETFD, 1)) {
|
||||
return OPAL_ERR_IN_ERRNO;
|
||||
}
|
||||
#endif
|
||||
|
||||
free(filename);
|
||||
}
|
||||
|
||||
/* Return successfully even if the session dir did not exist yet;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user