]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow empty strings to mean NULL
authorAlan T. DeKok <aland@freeradius.org>
Sat, 13 Aug 2011 14:56:28 +0000 (10:56 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 13 Aug 2011 18:13:56 +0000 (14:13 -0400)
this lets us specify the default (i.e. NULL) virtual server

src/main/client.c

index 6204759cb0917813e0eff3477edf4b91e5e30e3e..e986b1c29093b94f3cf9c9ee18d8c1ef35c4cec9 100644 (file)
@@ -1070,7 +1070,11 @@ RADCLIENT *client_create(RADCLIENT_LIST *clients, REQUEST *request)
                case PW_TYPE_STRING_PTR:
                        p = (char **) ((char *) c + dynamic_config[i].offset);
                        if (*p) free(*p);
-                       *p = strdup(vp->vp_strvalue);
+                       if (vp->vp_strvalue[0]) {
+                               *p = strdup(vp->vp_strvalue);
+                       } else {
+                               *p = NULL;
+                       }
                        break;
 
                case PW_TYPE_BOOLEAN: