Added a null-safe strdup variant

This commit is contained in:
Martin Willi
2011-01-05 16:46:02 +01:00
parent b0892d094c
commit 1038d9fee5
7 changed files with 13 additions and 8 deletions
@@ -235,7 +235,7 @@ METHOD(android_creds_t, set_username_password, void,
DESTROY_IF(this->user);
this->user = id->clone(id);
free(this->pass);
this->pass = password ? strdup(password) : NULL;
this->pass = strdupnull(password);
this->lock->unlock(this->lock);
}