| Directory: | cvmfs/ |
|---|---|
| File: | cvmfs/authz/authz.cc |
| Date: | 2025-11-09 02:35:23 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 8 | 9 | 88.9% |
| Branches: | 1 | 2 | 50.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /** | ||
| 2 | * This file is part of the CernVM File System. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #include "authz.h" | ||
| 6 | |||
| 7 | #include <cstring> | ||
| 8 | |||
| 9 | #include "util/smalloc.h" | ||
| 10 | |||
| 11 | 36 | AuthzToken *AuthzToken::DeepCopy() { | |
| 12 | 36 | AuthzToken *result = new AuthzToken(); | |
| 13 | 36 | result->type = this->type; | |
| 14 | 36 | result->size = this->size; | |
| 15 |
1/2✓ Branch 0 taken 36 times.
✗ Branch 1 not taken.
|
36 | if (this->size > 0) { |
| 16 | 36 | result->data = smalloc(result->size); | |
| 17 | 36 | memcpy(result->data, this->data, this->size); | |
| 18 | } else { | ||
| 19 | ✗ | result->data = NULL; | |
| 20 | } | ||
| 21 | 36 | return result; | |
| 22 | } | ||
| 23 |