Fix two "ignoring asprintf result" warnings
authorVolker Lendecke <vl@samba.org>
Sat, 19 Apr 2008 20:05:13 +0000 (22:05 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 19 Apr 2008 22:13:39 +0000 (00:13 +0200)
source/libads/ldap_printer.c

index e2396ce4cf83c51937d78094725ccdaebb38abb7..440f979781ecd5b04c257371f1b38308da510803 100644 (file)
@@ -288,9 +288,8 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
        uint32 i;
        POLICY_HND pol;
 
-       asprintf(&servername, "\\\\%s", cli->desthost);
-       asprintf(&printername, "%s\\%s", servername, printer);
-       if (!servername || !printername) {
+       if ((asprintf(&servername, "\\\\%s", cli->desthost) == -1)
+           || (asprintf(&printername, "%s\\%s", servername, printer) == -1)) {
                DEBUG(3, ("Insufficient memory\n"));
                return WERR_NOMEM;
        }