From 1a65ed410c555ace8c8e598ec911d84bbd860abc Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Jun 23 2015 21:31:25 +0000 Subject: Don't forget to close the output file structure In our current sorting-the-CA-certs stub function, don't forget to close the buffered FILE that we opened for writing to the output descriptor, and use _exit() instead of return to avoid messing with the parent process's exit handlers. Found by static analysis. --- diff --git a/src/cadata.c b/src/cadata.c index 2029df2..947b2e6 100644 --- a/src/cadata.c +++ b/src/cadata.c @@ -413,7 +413,8 @@ postprocess_certs_sub(int fd, struct cm_store_ca *ca, struct cm_store_entry *e, } fprintf(status, "%s\n", state->intermediate); fflush(status); - return 0; + fclose(status); + _exit(0); } static int