diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:45:43 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:45:43 +0100 |
commit | 03b9f2ca19c55216363e8d049418d0ee59d149f9 (patch) | |
tree | 21a17f1792321c88f534e8b7e36fa11e978c4cc7 /libftpconn | |
parent | 255112b27b106f70d9c9ef38cd8dff62777ba657 (diff) | |
download | hurd-03b9f2ca19c55216363e8d049418d0ee59d149f9.tar.gz hurd-03b9f2ca19c55216363e8d049418d0ee59d149f9.tar.bz2 hurd-03b9f2ca19c55216363e8d049418d0ee59d149f9.zip |
libftpconn: Fix memory leak on error
Diffstat (limited to 'libftpconn')
-rw-r--r-- | libftpconn/cwd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libftpconn/cwd.c b/libftpconn/cwd.c index 868150f1..e34fd407 100644 --- a/libftpconn/cwd.c +++ b/libftpconn/cwd.c @@ -41,7 +41,10 @@ _cache_cwd (struct ftp_conn *conn, int reopen) if (! cwd) err = ENOMEM; else if (sscanf (txt, "\"%[^\"]\"", cwd) != 1) - err = EGRATUITOUS; + { + free (cwd); + err = EGRATUITOUS; + } else { if (conn->cwd) |