sexpr_string: avoid leak on OOM error path

* src/xen/sexpr.c (sexpr_string): Free sexpr buffer upon allocation
failure.
This commit is contained in:
Jim Meyering 2010-02-04 17:55:15 +01:00
parent 04ebf058d5
commit a7e80e6bfd

View File

@ -119,6 +119,7 @@ sexpr_string(const char *str, ssize_t len)
}
if (ret->u.value == NULL) {
VIR_FREE(ret);
return NULL;
}