summaryrefslogtreecommitdiffstats
path: root/server/main_channel.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-03-20 20:29:15 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-03-23 13:10:54 +0100
commitd4ba4ee690aeb72b86c5342c77a54b5a1a185975 (patch)
tree746a0cb2d63eb7f003ea90a1963bf0aee3fd1bd3 /server/main_channel.c
parenta7d3f1de82e90da869775e8306e0dba7d95bd597 (diff)
downloadspice-d4ba4ee690aeb72b86c5342c77a54b5a1a185975.tar.gz
spice-d4ba4ee690aeb72b86c5342c77a54b5a1a185975.tar.xz
spice-d4ba4ee690aeb72b86c5342c77a54b5a1a185975.zip
Use spice_strdup() to avoid crashing on NULL
qemu can call spice_server_set_name(s, NULL) when the name is not given. Let's not crash in this case
Diffstat (limited to 'server/main_channel.c')
-rw-r--r--server/main_channel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/main_channel.c b/server/main_channel.c
index a9fd24ef..dbac010a 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -637,10 +637,10 @@ static void main_channel_fill_mig_target(MainChannel *main_channel, RedsMigSpice
{
ASSERT(mig_target);
free(main_channel->mig_target.host);
- main_channel->mig_target.host = strdup(mig_target->host);
+ main_channel->mig_target.host = spice_strdup(mig_target->host);
free(main_channel->mig_target.cert_subject);
if (mig_target->cert_subject) {
- main_channel->mig_target.cert_subject = strdup(mig_target->cert_subject);
+ main_channel->mig_target.cert_subject = spice_strdup(mig_target->cert_subject);
}
main_channel->mig_target.port = mig_target->port;
main_channel->mig_target.sport = mig_target->sport;