Commit 20eebc54 authored by Uri Lublin's avatar Uri Lublin
Browse files

empty_cd_clicked_cb: g_free basename



Fix the following static analyzer warning:
  src/usb-device-widget.c:224: leaked_storage: Failing to save or free
  storage allocated by "g_path_get_basename(filename)" leaks it.
Signed-off-by: Uri Lublin's avatarUri Lublin <uril@redhat.com>
parent df0d3f9d
......@@ -220,8 +220,10 @@ empty_cd_clicked_cb(GtkToggleButton *toggle, gpointer user_data)
rc = spice_usb_device_manager_create_shared_cd_device(priv->manager, filename, &err);
if (!rc && err != NULL) {
const gchar *basename = g_path_get_basename(filename);
gchar *err_msg = g_strdup_printf(_("shared CD %s, %s"),
g_path_get_basename(filename), err->message);
basename, err->message);
g_free((gpointer)basename);
SPICE_DEBUG("Failed to create %s", err_msg);
spice_usb_device_widget_add_err_msg(self, err_msg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment