diff options
author | Mike Kelly <mike@pair.com> | 2011-12-16 14:52:20 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-12-20 15:33:58 +0100 |
commit | d666318c7adae3c9a773844a74ec9cec3fba79b8 (patch) | |
tree | be2625b57dd72b777277a5a354c758cb653d3f2d /sshfs.c | |
parent | ea0d68651e0f1822f9e4bb3bd9fecb642078d01a (diff) | |
download | sshfs-d666318c7adae3c9a773844a74ec9cec3fba79b8.tar sshfs-d666318c7adae3c9a773844a74ec9cec3fba79b8.tar.gz sshfs-d666318c7adae3c9a773844a74ec9cec3fba79b8.tar.bz2 sshfs-d666318c7adae3c9a773844a74ec9cec3fba79b8.zip |
Fix a possible small memory leak
Diffstat (limited to 'sshfs.c')
-rw-r--r-- | sshfs.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1382,16 +1382,20 @@ static int sftp_init_reply_ok(struct buffer *buf, uint32_t *version) struct buffer buf2; buf_init(&buf2, len - 5); - if (do_read(&buf2) == -1) + if (do_read(&buf2) == -1) { + buf_free(&buf2); return -1; + } do { char *ext; char *extdata; if (buf_get_string(&buf2, &ext) == -1 || - buf_get_string(&buf2, &extdata) == -1) + buf_get_string(&buf2, &extdata) == -1) { + buf_free(&buf2); return -1; + } DEBUG("Extension: %s <%s>\n", ext, extdata); @@ -1407,6 +1411,7 @@ static int sftp_init_reply_ok(struct buffer *buf, uint32_t *version) strcmp(extdata, "1") == 0) sshfs.ext_hardlink = 1; } while (buf2.len < buf2.size); + buf_free(&buf2); } return 0; } |