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

Bug #1749917 reported by dcb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Atlas-C++
Invalid
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.

Revision history for this message
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.

Revision history for this message
dcb (dcb314) wrote :

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

Maybe that package is known to you ?

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.