MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / FreeContext

Function FreeContext

include/bmpread/bmpread.c:891–902  ·  view source on GitHub ↗

Frees resources allocated by various functions along the way. Only frees * data_out if !leave_data_out (if the bitmap loads successfully, you want the * data to remain until THEY free it). */

Source from the content-addressed store, hash-verified

889 * data to remain until THEY free it).
890 */
891static void FreeContext(read_context * p_ctx, int leave_data_out)
892{
893 if(p_ctx->fp)
894 fclose(p_ctx->fp);
895 if(p_ctx->palette)
896 free(p_ctx->palette);
897 if(p_ctx->file_data)
898 free(p_ctx->file_data);
899
900 if(!leave_data_out && p_ctx->data_out)
901 free(p_ctx->data_out);
902}
903
904int bmpread(const char * bmp_file, unsigned int flags, bmpread_t * p_bmp_out)
905{

Callers 1

bmpreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected