Skip to content

libssh2: fix memory leak in SSH_SFTP_REALPATH state - #16639

Closed
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:libssh2-leak
Closed

vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:libssh2-leak

Conversation

@vszakats

@vszakats vszakats commented Mar 9, 2025 •

Copy link
Copy Markdown
Member

Seen in MSVC libssh2 CI job:

test 0615...[SFTP put remote failure]
test 0616...[SFTP retrieval of empty file]
test 0618...[SFTP retrieval of two files]
test 0620...[SFTP retrieval of missing file followed by good file]
test 0622...[SFTP put failure]
  ** MEMORY FAILURE
  Leak detected: memory still allocated: 22 bytes
  At 2ae5b8a7ab8, there's 22 bytes.
   allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2006

https://github.com/curl/curl/actions/runs/13752652590/job/38455575042?pr=16636#step:14:3907 https://github.com/curl/curl/actions/runs/13752879003/job/38456075461

Bug: #16636 (comment)

vszakats added 2 commits March 9, 2025 23:29
Seen in MSVC libssh2 CI job:
```
test 0615...[SFTP put remote failure]
test 0616...[SFTP retrieval of empty file]
test 0618...[SFTP retrieval of two files]
test 0620...[SFTP retrieval of missing file followed by good file]
test 0622...[SFTP put failure]
  ** MEMORY FAILURE
  Leak detected: memory still allocated: 22 bytes
  At 2ae5b8a7ab8, there's 22 bytes.
   allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2006
```
https://github.com/curl/curl/actions/runs/13752652590/job/38455575042?pr=16636#step:14:3907
https://github.com/curl/curl/actions/runs/13752879003/job/38456075461
@github-actions github-actions Bot added the CI Continuous Integration label Mar 9, 2025
Comment thread lib/vssh/libssh2.c Resolved
Co-authored-by: Daniel Stenberg <[email protected]>
@vszakats vszakats closed this in 30739b4 Mar 10, 2025
@vszakats
vszakats deleted the libssh2-leak branch March 10, 2025 00:14
vszakats added a commit to vszakats/curl that referenced this pull request Mar 10, 2025
Seen sometimes with e.g. the 'msvc CM x64-windows openssl' job:
```
test 0618...[SFTP retrieval of two files]

** MEMORY FAILURE
Leak detected: memory still allocated: 22 bytes
At 185a1da6868, there's 22 bytes.
 allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2005
[...]
test 0622...[SFTP put failure]

** MEMORY FAILURE
Leak detected: memory still allocated: 22 bytes
At 1888c5b9928, there's 22 bytes.
 allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2005
```
Ref: https://github.com/curl/curl/actions/runs/13767215160/job/38496623071?pr=16653#step:14:2696

Follow-up to 30739b4 curl#16639
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Seen in MSVC libssh2 CI job:
```
test 0615...[SFTP put remote failure]
test 0616...[SFTP retrieval of empty file]
test 0618...[SFTP retrieval of two files]
test 0620...[SFTP retrieval of missing file followed by good file]
test 0622...[SFTP put failure]
test 0637...[SFTP retrieval with invalid X- range]
test 0640...[SFTP --head retrieval]
  ** MEMORY FAILURE
  Leak detected: memory still allocated: 22 bytes
  At 2ae5b8a7ab8, there's 22 bytes.
   allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2006
```
https://github.com/curl/curl/actions/runs/13752652590/job/38455575042?pr=16636#step:14:3907
https://github.com/curl/curl/actions/runs/13752879003/job/38456075461
https://github.com/curl/curl/actions/runs/13753706458/job/38457888479

Bug: curl#16636 (comment)
Co-authored-by: Daniel Stenberg

Closes curl#16639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration memory-leak SCP/SFTP

Development

Successfully merging this pull request may close these issues.

2 participants