Explorar el Código

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 hace 13 años
padre
commit
1772539a42
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. +2
    -1
      c_src/jiffy.c

+ 2
- 1
c_src/jiffy.c Ver fichero

@ -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);
}

Cargando…
Cancelar
Guardar