From 08a006d08a4c35d2c3ecc9a3d10cf7fd14661a84 Mon Sep 17 00:00:00 2001 From: Adam Weinberger Date: Tue, 29 Jul 2014 17:12:47 +0000 Subject: Rename all patches that contain '::' as a path separator, and use '__' instead. --- net/freeradius-client/files/patch-lib__config.c | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 net/freeradius-client/files/patch-lib__config.c (limited to 'net/freeradius-client/files/patch-lib__config.c') diff --git a/net/freeradius-client/files/patch-lib__config.c b/net/freeradius-client/files/patch-lib__config.c new file mode 100644 index 000000000000..337918e4c654 --- /dev/null +++ b/net/freeradius-client/files/patch-lib__config.c @@ -0,0 +1,55 @@ +--- lib/config.c ++++ lib/config.c +@@ -106,7 +106,7 @@ + serv = (SERVER *) option->val; + if (serv == NULL) { + DEBUG(LOG_ERR, "option->val / server is NULL, allocating memory"); +- serv = malloc(sizeof(*serv)); ++ serv = calloc(1, sizeof(*serv)); + if (serv == NULL) { + rc_log(LOG_CRIT, "read_config: out of memory"); + free(p_dupe); +@@ -313,8 +313,8 @@ + + authservers = rc_conf_srv(rh, "authserver"); + acctservers = rc_conf_srv(rh, "acctserver"); +- authservers = malloc(sizeof(SERVER)); +- acctservers = malloc(sizeof(SERVER)); ++ authservers = calloc(1, sizeof(SERVER)); ++ acctservers = calloc(1, sizeof(SERVER)); + + if(authservers == NULL || acctservers == NULL) + { +@@ -491,7 +491,7 @@ + option = find_option(rh, optname, OT_INT|OT_AUO); + + if (option != NULL) { +- return *((int *)option->val); ++ return option->val ? *((int *)option->val) : 0; + } else { + rc_log(LOG_CRIT, "rc_conf_int: unkown config option requested: %s", optname); + abort(); +@@ -528,17 +528,21 @@ + struct stat st; + char *file; + #endif ++ SERVER *srv = NULL; + +- if (!(rc_conf_srv(rh, "authserver")->max)) ++ srv = rc_conf_srv(rh, "authserver"); ++ if (!srv || !srv->max) + { + rc_log(LOG_ERR,"%s: no authserver specified", filename); + return -1; + } +- if (!(rc_conf_srv(rh, "acctserver")->max)) ++ srv = rc_conf_srv(rh, "acctserver"); ++ if (!srv || !srv->max) + { + rc_log(LOG_ERR,"%s: no acctserver specified", filename); + return -1; + } ++ + if (!rc_conf_str(rh, "servers")) + { + rc_log(LOG_ERR,"%s: no servers file specified", filename); -- cgit v1.2.3