]> git.sesse.net Git - vlc/blobdiff - modules/demux/asademux.c
dvb_scan: fix memleak.
[vlc] / modules / demux / asademux.c
index 81dbd88d6a2bf5c075f6d9681e7c78ea49584873..fa7303bf4dbafbcb5349d5fb6609a538f87f72b9 100644 (file)
 #define MAXDELTA       4       /**< nr of times kept for delta backref */
 #define MAXGROUP       24      /**< maximum number of regex match groups */
 
-#define xmalloc malloc
-#define xrealloc realloc
 #define xfree free
-#define xstrdup strdup
+static inline char *xstrdup(const char *str)
+{
+    char *ret = strdup (str);
+    if (unlikely(ret == NULL))
+        abort();
+    return ret;
+}
 
 /** state of a running import */
 struct asa_import_state {
@@ -97,7 +101,7 @@ static int asai_child  (iargs);
 #undef iargs
 
 /** vm functions. KEEP IN SYNC WITH imports.h! */
-static asa_import_func importfuncs[] = {
+static const asa_import_func importfuncs[] = {
        asai_commit,
        asai_discard,
        asai_break,