Re: [dm-devel] [dm- devel][PATCH] vector: return null when realloc fails in vector_alloc_slot func

2020-07-31 Thread Benjamin Marzinski
On Fri, Jul 31, 2020 at 06:41:57PM +0800, Zhiqiang Liu wrote: > > In vector_alloc_slot func, if REALLOC fails, it means new slot > allocation fails. However, it just update v->allocated and then > return the old v->slot without new slot. So, the caller will take > the last old slot as the new

[dm-devel] [dm- devel][PATCH] vector: return null when realloc fails in vector_alloc_slot func

2020-07-31 Thread Zhiqiang Liu
In vector_alloc_slot func, if REALLOC fails, it means new slot allocation fails. However, it just update v->allocated and then return the old v->slot without new slot. So, the caller will take the last old slot as the new allocated slot, and use it by calling vector_set_slot func. Finally, the