In timestamp_open() no need to free cookie on error, it is NULL.
Found by PVS-Studio.
This commit is contained in:
@@ -412,7 +412,7 @@ ts_init_key_nonglobal(struct timestamp_entry *entry, struct passwd *pw, int flag
|
|||||||
void *
|
void *
|
||||||
timestamp_open(const char *user, pid_t sid)
|
timestamp_open(const char *user, pid_t sid)
|
||||||
{
|
{
|
||||||
struct ts_cookie *cookie = NULL;
|
struct ts_cookie *cookie;
|
||||||
char *fname = NULL;
|
char *fname = NULL;
|
||||||
int tries, fd = -1;
|
int tries, fd = -1;
|
||||||
debug_decl(timestamp_open, SUDOERS_DEBUG_AUTH)
|
debug_decl(timestamp_open, SUDOERS_DEBUG_AUTH)
|
||||||
@@ -485,7 +485,6 @@ timestamp_open(const char *user, pid_t sid)
|
|||||||
bad:
|
bad:
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
close(fd);
|
close(fd);
|
||||||
free(cookie);
|
|
||||||
free(fname);
|
free(fname);
|
||||||
debug_return_ptr(NULL);
|
debug_return_ptr(NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user