Skip to content

Commit

Permalink
mv: fix double-free of fullname
Browse files Browse the repository at this point in the history
The new fullname variable is marked as _cleanup_free but the
pointer is only assigned in account->set_fullname(), not duplicated.

blob_free() frees the account which in turn frees account->fullname,
causing a double-free when the _cleanup_free function is called.

Signed-off-by: Bob Copeland <copeland@lastpass.com>
  • Loading branch information
Bob Copeland committed Jan 18, 2016
1 parent 4b1dbf2 commit c4ff93f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd-mv.c
Expand Up @@ -61,7 +61,7 @@ int cmd_mv(int argc, char **argv)
int option_index;
char *name;
char *folder;
_cleanup_free_ char *new_fullname = NULL;
char *new_fullname = NULL;
struct account *account;
struct share *old_share;

Expand Down

0 comments on commit c4ff93f

Please sign in to comment.