/src/FreeRDP/winpr/libwinpr/utils/collections/Object.c
Line | Count | Source (jump to first uncovered line) |
1 | | /** |
2 | | * WinPR: Windows Portable Runtime |
3 | | * Collections |
4 | | * |
5 | | * Copyright 2024 Armin Novak <anovak@thincast.com> |
6 | | * Copyright 2024 Thincast Technologies GmbH |
7 | | * |
8 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
9 | | * you may not use this file except in compliance with the License. |
10 | | * You may obtain a copy of the License at |
11 | | * |
12 | | * http://www.apache.org/licenses/LICENSE-2.0 |
13 | | * |
14 | | * Unless required by applicable law or agreed to in writing, software |
15 | | * distributed under the License is distributed on an "AS IS" BASIS, |
16 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 | | * See the License for the specific language governing permissions and |
18 | | * limitations under the License. |
19 | | */ |
20 | | #include <winpr/string.h> |
21 | | #include <winpr/collections.h> |
22 | | |
23 | | void* winpr_ObjectStringClone(const void* pvstr) |
24 | 0 | { |
25 | 0 | const char* str = pvstr; |
26 | 0 | if (!str) |
27 | 0 | return NULL; |
28 | 0 | return _strdup(str); |
29 | 0 | } |
30 | | |
31 | | void* winpr_ObjectWStringClone(const void* pvstr) |
32 | 0 | { |
33 | 0 | const WCHAR* str = pvstr; |
34 | 0 | if (!str) |
35 | 0 | return NULL; |
36 | 0 | return _wcsdup(str); |
37 | 0 | } |
38 | | |
39 | | void winpr_ObjectStringFree(void* pvstr) |
40 | 0 | { |
41 | 0 | free(pvstr); |
42 | 0 | } |