From c24408d2556ae1ec4c9676e4e57825978bb5dfcb Mon Sep 17 00:00:00 2001 From: Carles Pina Date: Thu, 20 Nov 2014 15:36:14 +0000 Subject: [PATCH] Close the file descriptor in the same method that had been opened. MD-20923 --- src/UpdateDialogGtkFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UpdateDialogGtkFactory.cpp b/src/UpdateDialogGtkFactory.cpp index b56745d..63612e8 100644 --- a/src/UpdateDialogGtkFactory.cpp +++ b/src/UpdateDialogGtkFactory.cpp @@ -37,7 +37,6 @@ UpdateDialogGtk* (*update_dialog_gtk_new)() = 0; bool extractFileFromBinary(int fd, const void* buffer, size_t length) { size_t count = write(fd,buffer,length); - close(fd); return count >= length; } @@ -58,6 +57,7 @@ UpdateDialog* UpdateDialogGtkFactory::createDialog() LOG(Warn,"Failed to load the GTK UI library - " + std::string(strerror(errno))); return 0; } + close(libFd); void* gtkLib = dlopen(libPath,RTLD_LAZY); if (!gtkLib)