]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle empty lists better
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 2 Dec 2012 12:39:10 +0000 (12:39 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 2 Dec 2012 12:45:04 +0000 (12:45 +0000)
src/modules/rlm_replicate/rlm_replicate.c

index 5a28e20b5738c9395127c477611797a6694ea02a..7125cbe02a4d7972d00c85935d8e358f2e55c08c 100644 (file)
@@ -148,12 +148,20 @@ static int replicate_packet(void *instance, REQUEST *request,
                                goto done;
                        }
                        
-                       packet->vps = paircopy(*vps);
-                       if (!packet->vps) {
-                               RDEBUG("ERROR: Out of memory!");
-                               rcode = RLM_MODULE_FAIL;
-                               goto done;
+                       /*
+                        *      Don't assume the list actually contains any
+                        *      attributes.
+                        */
+                       if (*vps) {
+                               packet->vps = paircopy(*vps);
+                               if (!packet->vps) {
+                                       RDEBUG("ERROR: Out of memory!");
+                                       rcode = RLM_MODULE_FAIL;
+                                       goto done;
+                               }
                        }
+                       
+
 
                        /*
                         *      For CHAP, create the CHAP-Challenge if
@@ -193,7 +201,8 @@ static int replicate_packet(void *instance, REQUEST *request,
                /*
                 *      Encode, sign and then send the packet.
                 */
-               RDEBUG("Replicating packet to Realm %s", realm->name);
+               RDEBUG("Replicating list '%s' to Realm '%s'",
+                      fr_int2str(pair_lists, list, "¿unknown?"),realm->name);
                if (rad_send(packet, NULL, home->secret) < 0) {
                        RDEBUG("ERROR: Failed replicating packet: %s",
                               fr_strerror());