]> git.mxchange.org Git - simgear.git/blobdiff - simgear/screen/screen-dump.cxx
fix a typo
[simgear.git] / simgear / screen / screen-dump.cxx
index 8251ab8c61e168eb9397d78c5c31c56ca69f572e..dc5ba7bd56eb0c9310ceb620b5b0e4c8db5bb7ea 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <simgear/compiler.h>
 
-#include SG_GL_H
+#include <osg/GL>
 
 #include "screen-dump.hxx"
 
@@ -55,6 +55,7 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
     ibuffer = (unsigned char *) malloc(win_width*win_height*RGB3);
 
     if ( (fp = fopen(filename, "wb")) == NULL ) {
+       free(ibuffer);
        printf("Warning: cannot open %s\n", filename);
        return false;
     }
@@ -71,8 +72,8 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
     fclose(fp);
     free(ibuffer);
 
-    printf("wrote file (%d x %d pixels, %d bytes)\n",
-          win_width, win_height, RGB3*win_width*win_height);
+    printf("wrote file '%s' (%d x %d pixels, %d bytes)\n",
+          filename, win_width, win_height, RGB3*win_width*win_height);
     return true;
 }