diff options
author | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-05-13 09:08:28 +0000 |
---|---|---|
committer | nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-05-13 09:08:28 +0000 |
commit | f9ef28505621fe12d2613e1bc1388a6147a81a06 (patch) | |
tree | 88db0b2d0f80e46991efc3b824ce91a9c9353306 /libmpdemux | |
parent | 72d780945809ab432e748e2a405e5fe8b2965404 (diff) |
prevent memleak
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18473 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/dvbin.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmpdemux/dvbin.c b/libmpdemux/dvbin.c index 143bf9302c..5374840eb4 100644 --- a/libmpdemux/dvbin.c +++ b/libmpdemux/dvbin.c @@ -779,7 +779,7 @@ dvb_config_t *dvb_get_config(void) char filename[30], *conf_file, *name; dvb_channels_list *list; dvb_card_config_t *cards = NULL; - dvb_config_t *conf = NULL; + dvb_config_t *conf = NULL, *tmp; if(dvb_config != NULL) return dvb_config; @@ -833,13 +833,14 @@ dvb_config_t *dvb_get_config(void) continue; size = sizeof(dvb_card_config_t) * (conf->count + 1); - cards = realloc(conf->cards, size); + tmp = realloc(conf->cards, size); - if(cards == NULL) + if(tmp == NULL) { fprintf(stderr, "DVB_CONFIG, can't realloc %d bytes, skipping\n", size); continue; } + cards = tmp; name = (char*) malloc(20); if(name==NULL) |