Everyone keeps talking about the dog as being "dangerous," but... isn't snarling/growling the dog's natural way of saying, "Back off!" Does it necessarily lead to attack if the person doesn't back off? I mean, this was a lab, for goodness sake! I know that there are always exceptions to the rule, but in my experience labs are generally pretty friendly family dogs. Isn't it possible that the dog would never have done anything beyond growling, but was using the growl to try to tell the kid to go away? Or is that not likely? The owner holding him back doesn't necessarily mean that she knew from experience that he was going to attack, just that his growling alarmed her and she wanted to be *sure* he couldn't do anything.
I have a 4-year-old, and if that child were 4, she could definitely be young enough, if her parents hadn't taught her, not to know how to behave around dogs. But it's *very* unlikely that she would also be at danger, as somebody suggested, for running out into the parking lot, etc. 4-year-olds are not toddlers and are generally fairly conversant. I always think of 4 as the point when they are really "kids" and not just babies/toddlers/preschoolers. The dog owner was probably reacting by controlling her dog, but probably also should have said something to the child about, "Please back away, you're scaring him and he needs his space," then, once the dog had calmed down, she could have tried to talk to the child about the way to approach the dog, if she thought it was just the child's approach that was lacking.
As the others have said, it's possible that the child did do something that made the dog angry. A few people have implied that it was *only* the child approaching the dog that set him off, and that's possible, but the OP was also busy with other things and looked over to see the dog growling/child approaching it. It's possible that something had happened before that moment, but we can't really know.
I do have lots of little kids, all of whom are fairly terrified of dogs because of being jumped on by off-leash dogs. So I do get fairly annoyed when people let their dogs approach my kids with the whole, "Oh, he won't hurt them!" attitude, because the dog may not *hurt* my child, but he's setting back all the hard work I've put in to getting them to not shriek in terror and try to climb me when a dog approaches them. Seriously, my child is 3 feet tall, stop letting your dog knock my child down and stand on her chest, you're scaring her to death! Ahem. But even though I am not a huge fan of unrestrained dogs, I would *not* blame the dog in this situation. He was in the vet's office, he was staying in one spot with his owner, and he was under her control at all times (yes, yes, he may have been *acting* as if he would try something, but keep in mind that he did *not* do anything, so we can't know what, if anything, he would have done). The child was the one who was approaching an animal that was possibly sick or in pain, and not reacting to the animal's "back off" signals. The mother should have been watching her child. If the child started walking around poking fingers in cages or trying to pet strange animals, that wouldn't have been okay, either. A vet's office is a huge temptation to a pet-loving child, and it's really a place, like a candy store or toy store, where a parent needs to keep tight control over their child so that nothing happens to the merchandise/other customers.