open-hpi / openhpi

Other
7 stars 10 forks source link

sahpi_gcrypt_utils.c:232]: (error) Resource leak: fconf #1997

Closed mohandev2 closed 6 years ago

mohandev2 commented 6 years ago

Source code is

            err = fwrite(out, 1, file_size, fconf);
            if (err != file_size ) {
                    CRIT("Wrote %d, but expected to write %ld",err, file_size);
                    g_free(plain_text);
                    g_free(out);
                    g_free(key);
                    return(NULL);
            }

Suggest add callto fclose( fconf) inside the if.

Reported by: dcb314

Original Ticket: openhpi/bugs/1997

mohandev2 commented 6 years ago

Original comment by: HemanthBeecherla