summaryrefslogtreecommitdiffstats
path: root/modalias.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-04-03 17:46:30 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-04-03 17:46:30 +0000
commitc332dcbce4b0030ece7a8bd88ac1bc15980ec47b (patch)
tree115cd907181f4ccc157fb1a6230c26e717f5a500 /modalias.c
parenta30eb33ddef01e39c044a33cd45af88292641406 (diff)
downloadldetect-c332dcbce4b0030ece7a8bd88ac1bc15980ec47b.tar
ldetect-c332dcbce4b0030ece7a8bd88ac1bc15980ec47b.tar.gz
ldetect-c332dcbce4b0030ece7a8bd88ac1bc15980ec47b.tar.bz2
ldetect-c332dcbce4b0030ece7a8bd88ac1bc15980ec47b.tar.xz
ldetect-c332dcbce4b0030ece7a8bd88ac1bc15980ec47b.zip
Check arguments for NULL in free functions
Diffstat (limited to 'modalias.c')
-rw-r--r--modalias.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/modalias.c b/modalias.c
index 790e71e..86494c6 100644
--- a/modalias.c
+++ b/modalias.c
@@ -15,6 +15,8 @@
static char *aliasdefault = NULL;
static void free_aliases(struct module_alias *aliases) {
+ if (aliases == NULL)
+ return;
while (aliases->next) {
struct module_alias *next;
next = aliases->next;
@@ -26,6 +28,8 @@ static void free_aliases(struct module_alias *aliases) {
}
static void free_options(struct module_options *modoptions) {
+ if (modoptions == NULL)
+ return;
while (modoptions->next) {
struct module_options *next;
next = modoptions->next;
@@ -38,6 +42,8 @@ static void free_options(struct module_options *modoptions) {
}
static void free_commands(struct module_command *commands) {
+ if (commands == NULL)
+ return;
while (commands->next) {
struct module_command *next;
next = commands->next;
@@ -50,6 +56,8 @@ static void free_commands(struct module_command *commands) {
}
static void free_blacklist(struct module_blacklist *blacklist) {
+ if (blacklist == NULL)
+ return;
while (blacklist->next) {
struct module_blacklist *next;
next = blacklist->next;