Hi Peng

On Wed, Nov 25, 2015 at 8:26 PM, Peng Fan <[email protected]> wrote:
> The following code will alloc memory for new_dev and ldev:
> "
> new_dev = mdio_alloc();
> ldev = malloc(sizeof(*ldev));
> "
> Either new_dev or ldev is NULL, directly return, but this may leak memory.
> So before return, using free(ldev) and mdio_free(new_dev) to avoid
> leaking memory, also free can handle NULL pointer.
>
> Signed-off-by: Peng Fan <[email protected]>
> Cc: Joe Hershberger <[email protected]>
> Cc: Simon Glass <[email protected]>
> Cc: Bin Meng <[email protected]>

Acked-by: Joe Hershberger <[email protected]>
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to