提交 6bb8edaf 编写于 作者: J Ján Tomko

qemuBuildSoundCommandLine: reduce scope of codecstr

Copy the declaration into the smallest blocks it's used in
and mark it as VIR_AUTOFREE.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 f9b650a8
......@@ -4478,9 +4478,9 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, str);
if (sound->model == VIR_DOMAIN_SOUND_MODEL_ICH6 ||
sound->model == VIR_DOMAIN_SOUND_MODEL_ICH9) {
char *codecstr = NULL;
for (j = 0; j < sound->ncodecs; j++) {
VIR_AUTOFREE(char *) codecstr = NULL;
virCommandAddArg(cmd, "-device");
if (!(codecstr =
qemuBuildSoundCodecStr(sound, sound->codecs[j],
......@@ -4489,9 +4489,9 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
}
virCommandAddArg(cmd, codecstr);
VIR_FREE(codecstr);
}
if (j == 0) {
VIR_AUTOFREE(char *) codecstr = NULL;
virDomainSoundCodecDef codec = {
VIR_DOMAIN_SOUND_CODEC_TYPE_DUPLEX,
0
......@@ -4504,7 +4504,6 @@ qemuBuildSoundCommandLine(virCommandPtr cmd,
}
virCommandAddArg(cmd, codecstr);
VIR_FREE(codecstr);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册