lib/mpi: added missing NULL check

Added missing NULL check after mpi_alloc().

Signed-off-by: Dmitry Kasatkin <[email protected]>
Reviewed-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
This commit is contained in:
Dmitry Kasatkin 2012-01-26 19:13:17 +02:00 • committed by James Morris
commit c70c471c58

View file

@ -79,7 +79,8 @@ MPI do_encode_md(const void *sha_buffer, unsigned nbits)
}
a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB);
mpi_set_buffer(a, frame, nframe, 0);
if (a)
mpi_set_buffer(a, frame, nframe, 0);
kfree(frame);
return a;