{"action":"created","issue":{"url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/43","repository_url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport","labels_url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/43/comments","events_url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/43/events","html_url":"https://github.com/Firwood-Software/AdvanceDLSupport/issues/43","id":345740883,"node_id":"MDU6SXNzdWUzNDU3NDA4ODM=","number":43,"title":"Clarification on strings and how they are free'd?","user":{"login":"pauldotknopf","id":523150,"node_id":"MDQ6VXNlcjUyMzE1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/523150?v=4","gravatar_id":"","url":"https://api.github.com/users/pauldotknopf","html_url":"https://github.com/pauldotknopf","followers_url":"https://api.github.com/users/pauldotknopf/followers","following_url":"https://api.github.com/users/pauldotknopf/following{/other_user}","gists_url":"https://api.github.com/users/pauldotknopf/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldotknopf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldotknopf/subscriptions","organizations_url":"https://api.github.com/users/pauldotknopf/orgs","repos_url":"https://api.github.com/users/pauldotknopf/repos","events_url":"https://api.github.com/users/pauldotknopf/events{/privacy}","received_events_url":"https://api.github.com/users/pauldotknopf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-07-30T12:41:39Z","updated_at":"2018-07-30T17:03:59Z","closed_at":null,"author_association":"NONE","body":"Consider this line of code.\r\n\r\n```c++\r\nQ_DECL_EXPORT LPCSTR qt_getenv(LPCSTR name)\r\n{\r\n    QByteArray result = qgetenv(name);\r\n    if(result.isNull()) {\r\n        return nullptr;\r\n    }\r\n    char* resultString = new char[static_cast<rsize_t>(result.size() + 1)];\r\n    strcpy_s(resultString, static_cast<rsize_t>(result.size() + 1), result.data());\r\n    return resultString;\r\n}\r\n```\r\n\r\n```c#\r\ninternal interface IQtInterop\r\n{\r\n    [NativeSymbol(Entrypoint = \"qt_putenv\")]\r\n    bool PutEnv([MarshalAs(UnmanagedType.LPStr)]string name [MarshalAs(UnmanagedType.LPStr)]string value);\r\n    [NativeSymbol(Entrypoint = \"qt_getenv\")]\r\n    [return: MarshalAs(UnmanagedType.LPStr)]string GetEnv(string name);\r\n}\r\n```\r\n\r\nWho is going to delete the buffer returned from ```qt_getenv```? Also, if null (```IntPtr.Zero```) is returned, I assume that the free'in stuff doesn't happen?"},"comment":{"url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/comments/408937047","html_url":"https://github.com/Firwood-Software/AdvanceDLSupport/issues/43#issuecomment-408937047","issue_url":"https://api.github.com/repos/Firwood-Software/AdvanceDLSupport/issues/43","id":408937047,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODkzNzA0Nw==","user":{"login":"pauldotknopf","id":523150,"node_id":"MDQ6VXNlcjUyMzE1MA==","avatar_url":"https://avatars1.githubusercontent.com/u/523150?v=4","gravatar_id":"","url":"https://api.github.com/users/pauldotknopf","html_url":"https://github.com/pauldotknopf","followers_url":"https://api.github.com/users/pauldotknopf/followers","following_url":"https://api.github.com/users/pauldotknopf/following{/other_user}","gists_url":"https://api.github.com/users/pauldotknopf/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldotknopf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldotknopf/subscriptions","organizations_url":"https://api.github.com/users/pauldotknopf/orgs","repos_url":"https://api.github.com/users/pauldotknopf/repos","events_url":"https://api.github.com/users/pauldotknopf/events{/privacy}","received_events_url":"https://api.github.com/users/pauldotknopf/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T17:03:59Z","updated_at":"2018-07-30T17:03:59Z","author_association":"NONE","body":"Your returning a const that's compiled in.\r\n\r\nTry to make your tests return a deletable char*."}}
{"actor":{"display_login":"pauldotknopf"}}