Philip Guenther wrote:
> Loganaden Velvindron wrote:
> > Michael McConville wrote:
> >> These seem like they were definitely meant to be explicit zeroings.
> >
> > I'm not entirely sure about this. Since the variable (data) is used
> > before return, it would not be optimized away by the compiler.
> >
> > [...]
> >
> > Or maybe I'm wrong here ?

> It might not be necessary from the optimization danger *right now*,
> but it may in the future, and serves as documentation of why you
> bothered to memset it (as opposed to doing so for some other reason,
> like so it can be reused, or to avoid double free of a pointer in it,
> etc).

Thanks, this is exactly how I was thinking of it.

Anecdotally, I dumped the binary and it seems that (at least with the
system compiler) memset was being called.

Reply via email to