]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink++.h
Fix a memory leak.
[meshlink] / src / meshlink++.h
index a1911affbdb1d949049e343b5cae5a4d732f0391..a357cca6516e24d96c0e13e23c7f570b6305b545 100644 (file)
@@ -319,7 +319,7 @@ namespace meshlink {
                 *  @return             A handle for the channel, or NULL in case of an error.
                 */
                channel *channel_open(node *node, uint16_t port, channel_receive_cb_t cb, const void *data, size_t len) {
-                       return (channel *)meshlink_channel_open(this, node, port, (meshlink_channel_receive_cb_t)recv, data, len);
+                       return (channel *)meshlink_channel_open(this, node, port, (meshlink_channel_receive_cb_t)cb, data, len);
                }
 
                /// Partially close a reliable stream channel.
@@ -387,6 +387,10 @@ namespace meshlink {
        static void close(mesh *mesh) {
                meshlink_close(mesh);
        }
+
+       static const char *strerror(errno_t err = meshlink_errno) {
+               return meshlink_strerror(err);
+       }
 };
 
 #endif // MESHLINKPP_H