
On Mon, May 11, 2009 at 08:54:23AM -0400, Cole Robinson wrote:
Daniel P. Berrange wrote:
On Mon, May 04, 2009 at 01:42:58PM -0400, Cole Robinson wrote:
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/test.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 95 insertions(+), 0 deletions(-)
+ + if (VIR_ALLOC_N(privvol->target.path, + strlen(privpool->def->target.path) + + 1 + strlen(privvol->name) + 1) < 0) { + virReportOOMError(pool->conn); + goto cleanup; + } + + strcpy(privvol->target.path, privpool->def->target.path); + strcat(privvol->target.path, "/"); + strcat(privvol->target.path, privvol->name); + privvol->key = strdup(privvol->target.path); + if (privvol->key == NULL) { + virReportOOMError(pool->conn); + goto cleanup; + }
Be a little shorter to just call virAsprintf() for target.path
ACK aside from that
Daniel
That's largely just duplication of code that was already in the storage driver, so there are other culprits as well. I'll send a cleanup patch after this series is applied (or before a v2) that fixes all the cases.
Sure, that works for me Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|