[vlc-devel] [PATCH 01/12] vlc: vlc_access_Delete: do nothing if argument is NULL
Filip Roséen
filip at videolabs.io
Mon Mar 14 11:08:52 CET 2016
---
include/vlc_access.h | 3 +++
src/input/access.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/include/vlc_access.h b/include/vlc_access.h
index e90edf1..5ec654d 100644
--- a/include/vlc_access.h
+++ b/include/vlc_access.h
@@ -136,6 +136,9 @@ VLC_API access_t *vlc_access_NewMRL(vlc_object_t *obj, const char *mrl);
/**
* Closes a byte stream.
+ *
+ * If the pointer passed to the function is NULL, the function does nothing.
+ *
* \param access byte stream to close
*/
VLC_API void vlc_access_Delete(access_t *access);
diff --git a/src/input/access.c b/src/input/access.c
index aac3d43..c14efad 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -146,6 +146,9 @@ access_t *vlc_access_NewMRL(vlc_object_t *parent, const char *mrl)
void vlc_access_Delete(access_t *access)
{
+ if( access == NULL )
+ return;
+
module_unneed(access, access->p_module);
free(access->psz_filepath);
--
2.7.3
More information about the vlc-devel
mailing list