summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 391ba2c1..6979e212 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1650,7 +1650,8 @@ static void handle_newstyle_request(struct subscriber_t *sub,
/* key side effect: watch all devices */
sub->watcher |= WATCH_NEWSTYLE;
for(devp = devices; devp < devices + MAXDEVICES; devp++)
- (void)assign_channel(sub, ANY, devp);
+ if (allocated_device(devp))
+ (void)assign_channel(sub, ANY, devp);
/* dump all devices */
json_watch_dump(&sub->policy,
reply + strlen(reply),