Re: [PATCH v4 04/13] commit-graph: implement write_commit_graph()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 19, 2018 at 7:53 PM, Derrick Stolee <stolee@xxxxxxxxx> wrote:

> +static int if_packed_commit_add_to_list(const struct object_id *oid,
> +                                       struct packed_git *pack,
> +                                       uint32_t pos,
> +                                       void *data)
> +{
> +       struct packed_oid_list *list = (struct packed_oid_list*)data;
> +       enum object_type type;
> +       unsigned long size;
> +       void *inner_data;
> +       off_t offset = nth_packed_object_offset(pack, pos);
> +       inner_data = unpack_entry(pack, offset, &type, &size);
> +
> +       if (inner_data)
> +               free(inner_data);

The condition is unnecessary, free() can handle a NULL argument just fine.

(Suggested by Coccinelle and 'contrib/coccinelle/free.cocci.patch'.)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux