Ver código fonte

Be paranoid about the values sent to upgrade

The docs aren't entirely clear on the order of calls for upgrades so
this is mostly just in case old_priv ever happens to not be what load
returned in priv.
pull/29/head 0.5.1
Paul J. Davis 13 anos atrás
pai
commit
1772539a42
1 arquivos alterados com 2 adições e 1 exclusões
  1. +2
    -1
      c_src/jiffy.c

+ 2
- 1
c_src/jiffy.c Ver arquivo

@ -42,7 +42,8 @@ reload(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
static int
upgrade(ErlNifEnv* env, void** priv, void** old_priv, ERL_NIF_TERM info)
{
enif_free(*old_priv);
if(*old_priv != NULL)
enif_free(*old_priv);
return load(env, priv, info);
}

Carregando…
Cancelar
Salvar