diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c index 622526bb47..2ec2424f88 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -227,14 +227,16 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state, goto cleanup; tmp = state->uri->path; - if (virAsprintf(&vol->key, "%s%s", state->uri->path, name) < 0) { + if (virAsprintf(&state->uri->path, "/%s", vol->key) < 0) { state->uri->path = tmp; goto cleanup; } if (!(vol->target.path = virURIFormat(state->uri))) { + VIR_FREE(state->uri->path); state->uri->path = tmp; goto cleanup; } + VIR_FREE(state->uri->path); state->uri->path = tmp; if (S_ISDIR(st->st_mode)) {