plug two config-parsing leaks

* src/storage_conf.c (virStoragePoolDefParsePerms): Free mode string.
(virStorageVolDefParsePerms): Likewise.
* AUTHORS: Update.
Patch by Ryota Ozaki.
This commit is contained in:
Jim Meyering 2009-03-02 10:26:37 +00:00
parent 07696eb347
commit 0fe3340ed9
3 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,7 @@ Patches have also been contributed by:
Itamar Heim <iheim@redhat.com>
Dave Allan <dallan@redhat.com>
Markus Armbruster <armbru@redhat.com>
Ryota Ozaki <ozaki.ryota@gmail.com>
[....send patches to get your name here....]

View File

@ -1,5 +1,11 @@
Mon Mar 2 10:16:04 +0100 2009 Jim Meyering <meyering@redhat.com>
plug two config-parsing leaks
* src/storage_conf.c (virStoragePoolDefParsePerms): Free mode string.
(virStorageVolDefParsePerms): Likewise.
Patch by Ryota Ozaki.
* AUTHORS: Update.
don't dereference uninitialized pointer
* src/storage_conf.c (virStoragePoolDefParsePerms): Initialize
"ptr" to NULL.

View File

@ -383,6 +383,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
} else {
char *end = NULL;
perms->mode = strtol(mode, &end, 8);
VIR_FREE(mode);
if (*end || perms->mode < 0 || perms->mode > 0777) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));
@ -812,6 +813,7 @@ virStorageVolDefParsePerms(virConnectPtr conn,
} else {
char *end = NULL;
perms->mode = strtol(mode, &end, 8);
VIR_FREE(mode);
if (*end || perms->mode < 0 || perms->mode > 0777) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));