]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only fclose open pointer
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 3 Apr 2013 01:07:10 +0000 (20:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 3 Apr 2013 01:07:10 +0000 (20:07 -0500)
src/switch_core_cert.c

index 5a56746fa135304a40012557460815e50f97472c..278e000bf62df456ed93f5fc9a1fd16c9c251813 100644 (file)
@@ -260,15 +260,13 @@ SWITCH_DECLARE(int) switch_core_gen_certs(const char *prefix)
        } else {
                if ((fp = fopen(pvt, "w"))) {
                        PEM_write_PrivateKey(fp, pkey, NULL, NULL, 0, NULL, NULL);
+                       fclose(fp);
                }
-
-               fclose(fp);
                
                if ((fp = fopen(rsa, "w"))) {
                        PEM_write_X509(fp, x509);
+                       fclose(fp);
                }
-
-               fclose(fp);
        }
 
        X509_free(x509);