- grr, warn_unused_result
authorMichael Schroeder <mls@suse.de>
Fri, 3 Jul 2009 10:43:57 +0000 (12:43 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 3 Jul 2009 10:43:57 +0000 (12:43 +0200)
examples/solv.c

index e7092a61deb13b6d37cf0260c14c72716fd84453..182b7d15dd923f85310638827affb19244d5bfef 100644 (file)
@@ -401,7 +401,13 @@ writecachedrepo(Repo *repo, unsigned char *cookie)
   repodata_internalize(info);
   repo_write(repo, fp, 0, 0, 0);
   repodata_free(info);
-  fwrite(cookie, 32, 1, fp);
+  if (fwrite(cookie, 32, 1, fp) != 1)
+    {
+      fclose(fp);
+      unlink(tmpl);
+      free(tmpl);
+      return;
+    }
   if (fclose(fp))
     {
       unlink(tmpl);