mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
lvmetad: check result of buffer_realloc
This commit is contained in:
parent
c4dcbf67a3
commit
5c792f620b
@ -289,8 +289,9 @@ int buffer_append(struct buffer *buf, const char *string)
|
||||
{
|
||||
int len = strlen(string);
|
||||
|
||||
if (buf->allocated - buf->used <= len)
|
||||
buffer_realloc(buf, len + 1);
|
||||
if ((buf->allocated - buf->used <= len) &&
|
||||
!buffer_realloc(buf, len + 1))
|
||||
return 0;
|
||||
|
||||
strcpy(buf->mem + buf->used, string);
|
||||
buf->used += len;
|
||||
|
Loading…
Reference in New Issue
Block a user