Revision 5e9b473a

b/spice-qemu-char.c
185 185
    printf("%s\n", __func__);
186 186
    vmc_unregister_interface(s);
187 187
    QLIST_REMOVE(s, next);
188

  
189
    g_free((char *)s->sin.subtype);
190
#if SPICE_SERVER_VERSION >= 0x000c02
191
    g_free((char *)s->sin.portname);
192
#endif
188 193
    g_free(s);
189 194
}
190 195

  
......
226 231
    s = g_malloc0(sizeof(SpiceCharDriver));
227 232
    s->chr = chr;
228 233
    s->active = false;
229
    s->sin.subtype = subtype;
234
    s->sin.subtype = g_strdup(subtype);
230 235
    chr->opaque = s;
231 236
    chr->chr_write = spice_chr_write;
232 237
    chr->chr_close = spice_chr_close;
......
284 289

  
285 290
    chr = chr_open("port");
286 291
    s = chr->opaque;
287
    s->sin.portname = name;
292
    s->sin.portname = g_strdup(name);
288 293

  
289 294
    return chr;
290 295
}

Also available in: Unified diff