Skip to content

Commit

Permalink
lib/mpi: added missing NULL check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Dmitry Kasatkin authored and James Morris committed Feb 1, 2012
1 parent 62aa2b5 commit c70c471
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mpi/mpicoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c70c471

Please sign in to comment.