diff options
author | Pavel Roskin <plroskin@gmail.com> | 2016-06-21 16:30:18 -0700 |
---|---|---|
committer | Pavel Roskin <plroskin@gmail.com> | 2016-07-08 04:29:49 +0000 |
commit | 5829323ad88f8120730968cfe165e590a7fb2d59 (patch) | |
tree | b5e13986d78de530a0a2168efdb95062e2803aca /sesman/chansrv/devredir.c | |
parent | a24df49241adc7c49dff777742d668f1d6c690ad (diff) | |
download | xrdp-proprietary-5829323ad88f8120730968cfe165e590a7fb2d59.tar.gz xrdp-proprietary-5829323ad88f8120730968cfe165e590a7fb2d59.zip |
Use g_new or g_new0 when C++ compiler would complain about implicit cast
Diffstat (limited to 'sesman/chansrv/devredir.c')
-rw-r--r-- | sesman/chansrv/devredir.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index c29c7e43..bb10a6c9 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -962,7 +962,8 @@ dev_redir_proc_query_dir_response(IRP *irp, //log_debug("FileNameLength: %d", FileNameLength); log_debug("FileName: %s", filename); - if ((xinode = calloc(1, sizeof(struct xrdp_inode))) == NULL) + xinode = g_new0(struct xrdp_inode, 1); + if (xinode == NULL) { log_error("system out of memory"); fuse_data = devredir_fuse_data_peek(irp); @@ -1378,7 +1379,8 @@ devredir_fuse_data_enqueue(IRP *irp, void *vp) if (irp == NULL) return -1; - if ((fd = calloc(1, sizeof(FUSE_DATA))) == NULL) + fd = g_new0(FUSE_DATA, 1); + if (fd == NULL) return -1; fd->data_ptr = vp; @@ -1481,7 +1483,7 @@ devredir_cvt_from_unicode_len(char *path, char *unicode, int len) bytes_to_alloc = (((len / 2) * sizeof(twchar)) + sizeof(twchar)); src = unicode; - dest = g_malloc(bytes_to_alloc, 1); + dest = g_new0(char, bytes_to_alloc); dest_saved = dest; for (i = 0; i < len; i += 2) |