loader.c:340]: (error) Resource leak: fptr

Bug #1749917 reported by dcb on 2018-02-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Atlas-C++
Undecided
Unassigned

Bug Description

    fptr = fopen(filename, "rb");
    if (fptr == NULL) {
        fprintf(stderr, "Unable to open file \"%s\".\n", filename);
        return NULL;
    }

    header = libmd3_header_load(fptr);

    if (header == NULL) {
        return NULL;
    }

Suggest add call to fclose(fptr) in final if.

Erik Ogenvik (erik-ogenvik) wrote :

I can't find the code you've posted in the Atlas project. As far as I know we don't use libmd3.

dcb (dcb314) wrote :

Source code file loader.c seems to be in package libmodelfile.

Maybe that package is known to you ?

Erik Ogenvik (erik-ogenvik) wrote :

Ah, that makes it clearer.
That package did originate with the Worldforge project, but we haven't maintained it for years. Where can I find the sources (we don't host them ourselves)?

Changed in atlas-cpp:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers