X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/6380d182cdde008560bc1381da208ce98bcb836a..9be3cef1df309cc384c37af980d379d465ab25e9:/emufs/tipo1.c diff --git a/emufs/tipo1.c b/emufs/tipo1.c index a8b5102..e703326 100644 --- a/emufs/tipo1.c +++ b/emufs/tipo1.c @@ -240,10 +240,12 @@ void* emufs_tipo1_leer_bloque(EMUFS* efs, EMUFS_BLOCK_ID block_id, int* err) if (block == NULL) { PERR("No hay memoria"); *err = EMUFS_ERROR_OUT_OF_MEMORY; + fclose(file); return NULL; } if (fread(block, efs->tam_bloque, 1, file) != 1) { free(block); + fclose(file); PERR("Error al leer bloque"); *err = EMUFS_ERROR_FILE_READ; return NULL;