Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
e5f21614
Commit
e5f21614
authored
Apr 01, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memleaks.
parent
f2600dd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
modules/misc/probe/hal.c
modules/misc/probe/hal.c
+15
-13
No files found.
modules/misc/probe/hal.c
View file @
e5f21614
...
...
@@ -71,7 +71,7 @@ static int Open( vlc_object_t *p_this )
DBusConnection
*
p_connection
;
probe_sys_t
*
p_sys
;
p_probe
->
p_sys
=
p_sys
=
(
probe_sys_t
*
)
malloc
(
sizeof
(
probe_sys_t
)
);
p_probe
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
probe_sys_t
)
);
p_probe
->
p_sys
->
i_devices
=
0
;
p_probe
->
p_sys
->
pp_devices
=
NULL
;
...
...
@@ -83,28 +83,29 @@ static int Open( vlc_object_t *p_this )
if
(
!
p_sys
->
p_ctx
)
{
msg_Err
(
p_probe
,
"unable to create HAL context"
)
;
free
(
p_
probe
->
p_
sys
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
p_connection
=
dbus_bus_get
(
DBUS_BUS_SYSTEM
,
&
dbus_error
);
if
(
dbus_error_is_set
(
&
dbus_error
)
)
{
msg_Err
(
p_probe
,
"unable to connect to DBUS: %s"
,
dbus_error
.
message
);
dbus_error_free
(
&
dbus_error
);
free
(
p_probe
->
p_sys
);
return
VLC_EGENERIC
;
goto
error
;
}
p_sys
->
p_connection
=
p_connection
;
libhal_ctx_set_dbus_connection
(
p_
probe
->
p_
sys
->
p_ctx
,
p_connection
);
if
(
!
libhal_ctx_init
(
p_
probe
->
p_
sys
->
p_ctx
,
&
dbus_error
)
)
libhal_ctx_set_dbus_connection
(
p_sys
->
p_ctx
,
p_connection
);
if
(
!
libhal_ctx_init
(
p_sys
->
p_ctx
,
&
dbus_error
)
)
{
msg_Err
(
p_probe
,
"hal not available : %s"
,
dbus_error
.
message
);
dbus_connection_unref
(
p_connection
);
goto
error
;
}
return
VLC_SUCCESS
;
error:
dbus_error_free
(
&
dbus_error
);
libhal_ctx_free
(
p_sys
->
p_ctx
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
/*****************************************************************************
...
...
@@ -115,6 +116,7 @@ static void Close( vlc_object_t *p_this )
device_probe_t
*
p_probe
=
(
device_probe_t
*
)
p_this
;
probe_sys_t
*
p_sys
=
p_probe
->
p_sys
;
dbus_connection_unref
(
p_sys
->
p_connection
);
libhal_ctx_free
(
p_sys
->
p_ctx
);
free
(
p_sys
);
}
#if 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment