s4:ntvfs: fix O3 error unused result of asprintf in svfs_file_utime
authorMichael Adam <obnox@samba.org>
Sat, 26 Mar 2016 01:08:41 +0000 (02:08 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:15 +0000 (00:16 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
source4/ntvfs/simple/svfs_util.c

index c4e015668c76ba7bf41e566eddec05aa8bab2323..171813bea21a9ce7e3dfe533b2a3323b75c783c7 100644 (file)
@@ -158,7 +158,12 @@ int svfs_file_utime(int fd, struct utimbuf *times)
        char *fd_path = NULL;
        int ret;
 
-       asprintf(&fd_path, "/proc/self/%d", fd);
+       ret = asprintf(&fd_path, "/proc/self/%d", fd);
+       if (ret == -1) {
+               errno = ENOMEM;
+               return -1;
+       }
+
        if (!fd_path) {
                errno = ENOMEM;
                return -1;