Certainly.
The else block in this case is executed when "NULL != fname" is false. That's an unnecessary double negative and takes a nonzero amount of mental effort to unscramble. The example I gave reverses this. This would also be acceptable:
if(fname) {
g = fopen(fname, "w+");
} else {
g = tmpfile();
}
(I also don't regard either statement as an "exceptional condition", they both seem equally likely to me.)