parallels: fix memory allocation

size of videos array must be increased.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
(cherry picked from commit 9ca569dedf)
This commit is contained in:
Dmitry Guryanov 2012-09-26 16:30:00 +04:00 committed by Cole Robinson
parent a8ad93965f
commit 3c860c40e3

View File

@ -277,7 +277,7 @@ parallelsAddVideoInfo(virDomainDefPtr def, virJSONValuePtr value)
if (VIR_ALLOC(accel) < 0)
goto no_memory;
if (VIR_REALLOC_N(def->videos, def->nvideos) < 0)
if (VIR_REALLOC_N(def->videos, def->nvideos + 1) < 0)
goto no_memory;
def->videos[def->nvideos++] = video;