Why am I getting a memory leakage? In function update_pic, the file is being closed using fclose(image);
typedef struct user {
    char name[MAX_NAME];
    char profile_pic[MAX_NAME];  // This is a *filename*, not the file contents.
    struct post *first_post;
    struct user *friends[MAX_FRIENDS];
    struct user *next;
} User;

/*
 * Change the filename for the profile pic of the given user.
 *
 * Return:
 *   - 0 on success.
 *   - 1 if the file does not exist or cannot be opened.
 *   - 2 if the filename is too long.
 */
int update_pic(User *user, const char *filename) {
    if (strlen(filename) >= MAX_NAME) {
        return 2;
    } else {
        FILE* image;

        image = fopen(filename, "r");

        if (image == NULL) {
            return 1;
        } else {
            strcpy(user->profile_pic, filename);
            return 0;
        }

        fclose(image);

    }
}

int print_user(const User *user) {
    if (user == NULL) {
        return 1;
    } else {

        // Prints the profile_pic
        FILE *pic;

        if (user->profile_pic[0] != '\0') {
            pic = fopen(user->profile_pic, "r");
            char line[100];

            if (pic != NULL) {
                while (fgets(line, 100, pic) != NULL) {
                    printf("%s", line);
                }
                printf("\n");
            }
        }
        fclose(pic);
    }