bb_full_fd_action: remove potential xmalloc from NOFORK path
[platform/upstream/busybox.git] / procps / sysctl.c
index b5a0189..7c72ac9 100644 (file)
@@ -202,7 +202,8 @@ int sysctl_write_setting(const char *setting, int output)
        while ((cptr = strchr(outname, '/')) != NULL)
                *cptr = '.';
 
-       if ((fd = open(tmpname, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
+       fd = open(tmpname, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+       if (fd < 0) {
                switch (errno) {
                case ENOENT:
                        bb_error_msg(ERR_INVALID_KEY, outname);