He was assessing the risk, and he was disclosing more information than he intended to.
He already knew how to make horcruxes.
Just to get this out of the way: Riddle did not approach Slughorn to find out how to make horcruxes, this has been asked and answered a couple of times on this page already.
He wanted to know what would happen, possibly assessing the risk for his own safety
Dumbledore points out that creating more than one Horcrux was completely unheard of, so it makes sense for Riddle to get another opinion before proceeding tampering with his own soul further.
'You heard Voldemort: What he particularly wanted from Horace was an opinion on what would happen to the wizard who created more than one Horcrux, what would happen to the wizard so determined to evade death that he would be prepared to murder many times, rip his soul repeatedly, so as to store it in many, separately concealed Horcruxes. No book would have given him that information.'
(Harry Potter and the Half-Blood Prince: Horcruxes)
He can't know the benefits of his conversation before having it
You're arguing with the benefit of hindsight that the discussion between Slughorn and Riddle didn't provide him with any benefits. Yet, Riddle could not have fully known that prior to the discussion.
Slughorn is about the only person to talk to about Horcruxes
Slughorn is well-connected even in the more shady wizarding world, and open to discuss equally shady topics, as he acknowledges the curiosity about these things:
"It's natural to feel some curiosity about these things... wizards of a certain calibre have always been drawn to that aspect of magic..."
(Harry Potter and the Half-Blood Prince: Horcruxes)
At the same time, Horcruxes are a fiercely banned topic at Hogwarts, which is mentioned in the same chapter. Adding how easily Slughorn is available and how easy it is for Riddle to manipulate him, he seems like an obvious choice to approach.
As to the risks: Voldemort might not have realized what he disclosed
My personal interpretation of the whole exchange was that at this point Riddle's mind was already made up to make more than one Horcrux, he was simply looking either for confirmation that it was possible, or for any obvious red flag that would have prevented him from proceeding (Like: "Wizard Fugnald tried this once and blew himself into pieces, so don't try it"). He is pressing Slughorn very hard, and all he is getting as a response is that there are merely moral boundaries to his plan, which, as we know, Riddle is happy to cross.
I think his own impatience made him blurt out more of his plan than he intended to. His impatience is mentioned in the build-up:
"...few would want it, Tom, very few. Death would be preferable." But Riddle's hunger was now apparent; his expression was greedy, he could no longer hide his longing.
(Harry Potter and the Half-Blood Prince: Horcruxes)
Then, when he is finally past all the topics that he already knows of and gets to the whole point of the conversation, he spills it all and Slughorn even interrupts him (otherwise he might have disclosed even more):
'I mean, would one Horcrux be much use? Can you only split your soul once? Wouldn't it be better, make you stronger, to have your soul in more pieces? I mean, for instance, isn't seven the most powerfully magical number, wouldn't seven-?' 'Merlin's Beard, Tom!' yelped Slughorn.
(Harry Potter and the Half-Blood Prince: Horcruxes)
Riddle then leaves, and my interpretation is that Slughorn gave him the confirmation he needed now. Given his emotional state at this point, it is likely he didn't realize what he just shared with the teacher:
'I won't say a word, sir,' said Riddle and he left, but not before Harry had glimpsed his face, which was full of the same wild happiness it had worn when he had first found out that he was a wizard, the sort of happiness that did not enhance his handsome features, but made them, somehow, less human...
(Harry Potter and the Half-Blood Prince: Horcruxes)