X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-md5.c;h=09b6291372fa4e6c847a981044dcf077aabb8ef9;hb=5d608d3cbc2c5c95b3899ed66dc484d9a5f1fe38;hp=c4e0438a0310d2e21bc5bea0ec4c0bf2b3dbf073;hpb=c4a3b30460c7ea1a1fb3c97cfc8478555714af2f;p=mono.git diff --git a/mono/utils/mono-md5.c b/mono/utils/mono-md5.c index c4e0438a031..09b6291372f 100644 --- a/mono/utils/mono-md5.c +++ b/mono/utils/mono-md5.c @@ -326,6 +326,8 @@ mono_md5_get_digest (const guchar *buffer, gint buffer_size, guchar digest[16]) * * Get the md5 hash of a file. The result is put in * the 16 bytes buffer @digest . + * + * If an IO error happens the value in @digest is not updated. **/ void mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]) @@ -347,6 +349,8 @@ mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]) if (ferror(fp)) { fclose(fp); return; + } else { + fclose(fp); } mono_md5_final (&ctx, digest);