Page MenuHomePhabricator

What to do with sftp_canonicalize_path's returned pointer?
Closed, ResolvedPublic


The function sftp_canonicalize_path() is documented to return "The canonicalize path" but there's no mention where the memory for that string comes from or what's needed from an application to do with that pointer when done with it.

I presume then that libssh handles that memory automatically by itself when the application closes the sftp session? It would be useful with having this stated explicitly in the documentation.

Event Timeline

bagder created this task.Dec 21 2018, 1:14 PM
asn added a subscriber: asn.Feb 27 2019, 8:34 AM

Thank you very much for the bug report.

The function returns newly allocated memory which needs to be freed using ssh_string_free_char(). I will update the documentation accordingly.