diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index f54868f80..693667bbf 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.116 - ==================================== + Use fully aligned allocations for dm_pool_strdup/strndup() (1.02.64). Fix thin-pool table parameter feature order to match kernel output. Version 1.02.115 - 25th January 2016 diff --git a/libdm/mm/pool.c b/libdm/mm/pool.c index ec6f1b859..c1cb61e29 100644 --- a/libdm/mm/pool.c +++ b/libdm/mm/pool.c @@ -48,17 +48,18 @@ static size_t pagesize_mask = 0; char *dm_pool_strdup(struct dm_pool *p, const char *str) { - char *ret = dm_pool_alloc_aligned(p, strlen(str) + 1, 2); + size_t len = strlen(str) + 1; + char *ret = dm_pool_alloc(p, len); if (ret) - strcpy(ret, str); + memcpy(ret, str, len); return ret; } char *dm_pool_strndup(struct dm_pool *p, const char *str, size_t n) { - char *ret = dm_pool_alloc_aligned(p, n + 1, 2); + char *ret = dm_pool_alloc(p, n + 1); if (ret) { strncpy(ret, str, n);