strlen seems to operate in 32-bit chunks, but libmtd sometimes allocates
strings without that much padding. This patch adds something extra to
a string allocation so that the mtd ioengine is clean with respect
to valgrind memory access checks.
Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
size_t len1 = strlen(path);
size_t len2 = strlen(name);
- n = xmalloc(len1 + len2 + 2);
+ n = xmalloc(len1 + len2 + 6);
memcpy(n, path, len1);
if (n[len1 - 1] != '/')