<p>Tim, to be sure about understanding: <code>realloc</code> does the right thing, it leaves the original alone.<br>
It's we, programmers that do not do the right thing: we overwrite a valid pointer with a NULL pointer. And now, there is no references to the valid pointer anymore => memory leak (+ eventually other side effects of having a NULL pointer hanging).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/335#issuecomment-450888651">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyWwEfduTaJN4uwAv8CyGbiccGldXjks5u_MxsgaJpZM4ZmCfu">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW3oAvKx3PxI4frK3DdgMNVWSMVT-ks5u_MxsgaJpZM4ZmCfu.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@nicolas-cellier-aka-nice in #335: Tim, to be sure about understanding: `realloc` does the right thing, it leaves the original alone.\r\nIt's we, programmers that do not do the right thing: we overwrite a valid pointer with a NULL pointer. And now, there is no references to the valid pointer anymore =\u003e memory leak (+ eventually other side effects of having a NULL pointer hanging)."}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/335#issuecomment-450888651"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/335#issuecomment-450888651",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/335#issuecomment-450888651",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>