Return {error, enonmem} in OOM situations

This commit is contained in:
Carlos Martín Nieto
2013-05-02 11:37:35 +02:00
parent 0aa11d8532
commit ef7d2d5490
11 changed files with 56 additions and 39 deletions

View File

@@ -39,7 +39,7 @@ geef_blob_content(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
return atoms.error;
if (!enif_alloc_binary(len, &bin))
return atoms.error;
return geef_oom(env);
memcpy(bin.data, content, len);