FireEye’s stock is up 15 percent after hours today, as the company lost money in its third quarter — but not as much as analysts were expecting.

The gains could be read as a sigh of relief, as the security vendor's investors had plenty to be worried about. FireEye has been having trouble with "significant competition from firewall vendors, more defections in the sales ranks, and a lukewarm spending environment," analyst Catharine Trebnick of Dougherty & Co. wrote in a research note earlier this week.

FireEye today reported non-GAAP net losses of 18 cents per share — but that was a whole lot better than the losses of 31 cents per share that analysts expected, according to Thomson Financial.

Revenues outdid expectations as well, coming in at $186.4 million, compared with $165.6 million in the same quarter last year.

FireEye beat its own third-quarter forecast of $180 million to $186 million in revenues. For the fourth quarter, it is predicting revenues of $187 million to $193 million.

That prediction falls short, according to Trebnick; she was expecting fourth-quarter revenues of $195.9 million.

Finally, FireEye's GAAP losses totaled $123.4 million, or 75 cents per share, compared with losses of $135.5 million, or 88 cents per share, a year ago.

Security Slump

Comparatively, FireEye had a better quarter than some prominent security peers did.

Fortinet had warned that its third-quarter earnings would sag, which they did, and Palo Alto Networks got a wary reception from investors after reporting its earnings in August.

Both companies are in the firewall business, though, handling perimeter security. FireEye is better known for threat intelligence, comparing network behavior to known attacks or attack patterns.

Still, enterprise security spending has been lavish for about three years, as UBS analyst Brett Thill has been noting in his reports, so a pause in spending isn't surprising. "We expect the next stage of the spending cycle to intensify competitively," he wrote in a research note in October.

FireEye has some internal factors to deal with as well. The company shuffled the executive ranks and replaced its CEO in June, then announced layoffs of 350 in August.