(CNN) -

Does the David Petraeus extramarital affair pose a threat to national security?

The scandal reinforces the risks of age-old intelligence-gathering landmines -- be careful what you say and where you say it.

But analysts doubt national security was compromised.

"Petraeus' potential exposure to blackmail, and the dangers associated with the use of nonofficial email accounts that he needed to keep the affair secret, made this a potential national security issue," said Stephen Biddle, a professor of political science and international affairs at The George Washington University.

"The FBI concluded that this was only potential, and that no meaningful security breaches had actually occurred, but the affair created a risk that could have been exploited in the future."

Petraeus resigned last week from the head of the CIA after admitting an affair with a woman later identified as his biographer, Paula Broadwell, 40, a fellow West Point graduate who spent months studying the general's leadership of U.S. forces in Afghanistan.

The revelation came during an FBI probe of another matter, and it led to the shocking fall of the celebrated and revered four-star Army general, who once ran the wars in Iraq and Afghanistan.

The affair came to light during an FBI investigation of "jealous" e-mails reportedly sent by Broadwell to a U.S. Central Command volunteer named Jill Kelley, a government source familiar with the investigation told CNN on Monday.

Kelley received the worrisome e-mails in May, an official said, describing the messages as along the lines of "stay away from my guy," but not explicitly threatening.

According to a source with knowledge of the emails, the messages accused Kelley of untoward behavior with some generals at MacDill Air Force Base in Tampa, Florida, where Kelley did volunteer work.

The emails detailed the "comings and goings of the generals and Ms. Kelley," said the source, who declined to speak on the record because of sensitivity of the investigation.

Among those believed to be referenced in the emails was Petreaus. Because parts of Petreaus' schedule were not public, the emails raised questions about whether the sender of the emails had access to his private schedule or other sensitive information.

Kelley, 37, and her husband, Scott, released a statement saying they have been friends with Petraeus and his family for more than five years and asked for privacy.

Robert Baer, a CNN contributor and former CIA operative, said the situation is troubling because Petraeus could have innocently told Broadwell secrets he shouldn't have in casual conversation.

Also, in a speech at the end of October, Broadwell suggested the terrorist attack on the U.S. Consulate in Benghazi, Libya, took place because the United States was housing Libyan prisoners there -- a theory, she noted at the time, that had not been vetted yet. The claim by Broadwell has since been discounted by administration officials.

Baer said it's rare in a relationship that a person wouldn't cross the line and say things he or she shouldn't have said.

But "my gut is there's nothing there," he said, and that Petraeus didn't say anything he shouldn't have to Broadwell.

Nevertheless, he said, the "potential is big here for policy and security implications."

"It's a spy agency's worst nightmare," he said. "They've let an outsider in, which is always a terrible error."

As for the morality of the situation, Baer said extramarital relations do happen when the Army and the CIA go to war.