win32.c realpath(): Don't allocate extra byte
authorEric Biggers <ebiggers3@gmail.com>
Thu, 21 Mar 2013 18:54:21 +0000 (13:54 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 21 Mar 2013 18:54:21 +0000 (13:54 -0500)
src/win32.c

index 6d3951f..f094656 100644 (file)
@@ -1180,7 +1180,7 @@ realpath(const mbchar *path, mbchar *resolved_path)
        if (!ret)
                goto fail_win32;
 
-       resolved_path = MALLOC(ret + 1);
+       resolved_path = MALLOC(ret);
        if (!resolved_path)
                goto fail;
        ret = GetFullPathNameA(path, ret, resolved_path, NULL);