Skip to content

Commit

Permalink
Fix double free in oom *_set_error()
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
  • Loading branch information
sahlberg committed May 4, 2024
1 parent 0b148f1 commit b2f2029
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/init.c
Expand Up @@ -325,7 +325,6 @@ void rpc_set_error(struct rpc_context *rpc, const char *error_string, ...)
va_start(ap, error_string); va_start(ap, error_string);
rpc->error_string = malloc(1024); rpc->error_string = malloc(1024);
if (rpc->error_string == NULL) { if (rpc->error_string == NULL) {
free(old_error_string);
rpc->error_string = discard_const(oom); rpc->error_string = discard_const(oom);
goto finished; goto finished;
} }
Expand Down
1 change: 0 additions & 1 deletion lib/libnfs.c
Expand Up @@ -2242,7 +2242,6 @@ nfs_set_error(struct nfs_context *nfs, char *error_string, ...)
va_start(ap, error_string); va_start(ap, error_string);
nfs->error_string = malloc(1024); nfs->error_string = malloc(1024);
if (nfs->error_string == NULL) { if (nfs->error_string == NULL) {
free(old_error_string);
nfs->error_string = discard_const(oom); nfs->error_string = discard_const(oom);
goto finished; goto finished;
} }
Expand Down

0 comments on commit b2f2029

Please sign in to comment.