- /* If not ephemeral, store cached image, and free image data */
- if (!bitmap->ephemeral) {
-
- /* Create surface from image data */
- cairo_surface_t* surface = cairo_image_surface_create_for_data(
- image_buffer, CAIRO_FORMAT_RGB24,
- bitmap->width, bitmap->height, 4*bitmap->width);
-
- /* Send surface to buffer */
- guac_protocol_send_png(socket,
- GUAC_COMP_SRC, buffer, 0, 0, surface);
-
- /* Free surface */
- cairo_surface_destroy(surface);
-
- /* Free image data if actually alloated */
- if (image_buffer != bitmap->data)
- free(image_buffer);
-
- }
-
- /* Otherwise, store converted image in bitmap, free any existing */
- else {
+ /* Free existing image, if any */
+ if (image_buffer != bitmap->data)
+ free(bitmap->data);