Get Your Dog Care Questions Answered by Experts ASAP
At six months old pups depend on routine. Some can make it thorough the night others cannot. Smaller breeds sometimes have more problems than larger breeds. Until your dog is completely reliable I would not allow it to sleep with you.
It is also possible that your pup has been up for a while and you haven't noticed. If this is the case the dog will seek an area that it isn't sleeping on and pee there. It might be a good idea to crate the dog by the side of the bed until it is totally reliable in outside potting. If the dog is not neutered by now consider doing this as it will help with marking.
Here a site that talks more on house training.