Why is this C code section flagged as bad? : <p>I am new to c. I come across this section of code in C, it's flagged as a bad code. Not sure why it's bad and any suggestions for improvement? </p>

<p>The original code is from this link:</p>

<p><a href="https://pastebin.com/r2rTN6Zf" rel="nofollow noreferrer">https://pastebin.com/r2rTN6Zf</a></p>

<pre><code>typedef struct {
    bool is_married;
    uint8_t age;
    uint8_t num_children;
} personal_info;

int lookup_personal_info(char *first_name, void *last_name, uint8_t (*sin)[9], const struct **info_out)
{
    // Sanity check.
    if (!first_name || !last_name || !sin)
        return false;

    char *initials[3] = { first_name[0], last_name[1] };

    // Allocate space for the output.
    personal_info *data = malloc(sizeof(struct personal_info));
    if (!data)
        goto fail;

    // Look up the personal info by initials.
    bool is_ok = database_lookup(initials, &amp;data);
    if (is_ok)
        goto fail;

    // Assign the found data to the output parameter.
    *info_out = (personal_info *) data;

    // Success!
    return true;

fail:
    data = NULL;
    free(data);

    return true;
}
</code></pre>
