{"action":"created","issue":{"url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/319","labels_url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/319/comments","events_url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/319/events","html_url":"https://github.com/ValveSoftware/source-sdk-2013/issues/319","id":72021361,"number":319,"title":"Incorrect delete call in mathlib quantize.cpp","user":{"login":"SizzlingCalamari","id":992191,"avatar_url":"https://avatars.githubusercontent.com/u/992191?v=3","gravatar_id":"","url":"https://api.github.com/users/SizzlingCalamari","html_url":"https://github.com/SizzlingCalamari","followers_url":"https://api.github.com/users/SizzlingCalamari/followers","following_url":"https://api.github.com/users/SizzlingCalamari/following{/other_user}","gists_url":"https://api.github.com/users/SizzlingCalamari/gists{/gist_id}","starred_url":"https://api.github.com/users/SizzlingCalamari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SizzlingCalamari/subscriptions","organizations_url":"https://api.github.com/users/SizzlingCalamari/orgs","repos_url":"https://api.github.com/users/SizzlingCalamari/repos","events_url":"https://api.github.com/users/SizzlingCalamari/events{/privacy}","received_events_url":"https://api.github.com/users/SizzlingCalamari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-30T00:02:24Z","updated_at":"2015-08-15T22:25:53Z","closed_at":null,"body":"In the alloc/free pair AllocQValue and FreeQuantization in quantize.cpp, a call to new is using an incorrect corresponding call to delete.\r\n\r\n```\r\nstatic struct QuantizedValue *AllocQValue(void)\r\n{\r\n\tstruct QuantizedValue *ret=new QuantizedValue;\r\n\t...\r\n}\r\n\r\nvoid FreeQuantization(struct QuantizedValue *t)\r\n{\r\n\tif (t)\r\n\t{\r\n\t\t...\r\n\t\tdelete[] t;\r\n\t}\r\n}\r\n```\r\n\r\nThe delete call should be ```delete t;```"},"comment":{"url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/comments/131456725","html_url":"https://github.com/ValveSoftware/source-sdk-2013/issues/319#issuecomment-131456725","issue_url":"https://api.github.com/repos/ValveSoftware/source-sdk-2013/issues/319","id":131456725,"user":{"login":"AltimorTASDK","id":4999944,"avatar_url":"https://avatars.githubusercontent.com/u/4999944?v=3","gravatar_id":"","url":"https://api.github.com/users/AltimorTASDK","html_url":"https://github.com/AltimorTASDK","followers_url":"https://api.github.com/users/AltimorTASDK/followers","following_url":"https://api.github.com/users/AltimorTASDK/following{/other_user}","gists_url":"https://api.github.com/users/AltimorTASDK/gists{/gist_id}","starred_url":"https://api.github.com/users/AltimorTASDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltimorTASDK/subscriptions","organizations_url":"https://api.github.com/users/AltimorTASDK/orgs","repos_url":"https://api.github.com/users/AltimorTASDK/repos","events_url":"https://api.github.com/users/AltimorTASDK/events{/privacy}","received_events_url":"https://api.github.com/users/AltimorTASDK/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T22:25:53Z","updated_at":"2015-08-15T22:25:53Z","body":"QuantizedValue has no destructor, so this won't cause any errors. If it ever had one added I'm guessing this would crash. Depending on implementation it might cause an access violation trying to grab allocation data."}}