Commit 73ac79ed 73ac79ed1184440e75bd982560387636553aae23 by Sam Roberts

Set zero-length strings to NULL.

1 parent 9c8700e4
...@@ -170,9 +170,12 @@ url_parse (url_t url) ...@@ -170,9 +170,12 @@ url_parse (url_t url)
170 170
171 171
172 #define UALLOC(X) \ 172 #define UALLOC(X) \
173 if(u.X && (url->X = url_decode(u.X)) == 0) { \ 173 if(u.X && u.X[0] && (url->X = url_decode(u.X)) == 0) { \
174 err = ENOMEM; \ 174 err = ENOMEM; \
175 goto CLEANUP; \ 175 goto CLEANUP; \
176 } else { \
177 /* Set zero-length strings to NULL. */ \
178 u.X = NULL; \
176 } 179 }
177 180
178 UALLOC (scheme) 181 UALLOC (scheme)
......