why casting pointer in mutt_mem_free

Yubin Ruan ablacktshirt at gmail.com
Tue Mar 27 07:04:34 UTC 2018


In mutt/memory.c, what is point of casting ptr from (void *) to (void **)? Any
ancient C technique here?

void mutt_mem_free(void *ptr)
{
  if (!ptr)
    return;
  void **p = (void **) ptr;
  if (*p)
  {
    free(*p);
    *p = 0;
  }
}

Yubin


More information about the Mutt-dev mailing list