From d54fe7a27ca63446a689c4020473c47e4bf787fc Mon Sep 17 00:00:00 2001 From: graham.gower Date: Sun, 22 Nov 2009 18:15:15 -0500 Subject: Add some error checking on fputs. git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg') diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c index 4257d59..e1b4018 100644 --- a/libopkg/pkg_extract.c +++ b/libopkg/pkg_extract.c @@ -37,7 +37,11 @@ int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream) return EINVAL; } - fputs(buffer, stream); + if (fputs(buffer, stream) == EOF) { + free(buffer); + return EINVAL; + } + free(buffer); return 0; -- cgit v0.9.1