Tejaswikandula commented on code in PR #450:
URL: https://github.com/apache/guacamole-server/pull/450#discussion_r1258930204


##########
src/common-ssh/user.c:
##########
@@ -80,3 +82,15 @@ int guac_common_ssh_user_import_key(guac_common_ssh_user* 
user,
 
 }
 
+int guac_common_ssh_user_import_public_key(guac_common_ssh_user* user,
+        char* public_key) {
+
+    /* Free existing public key, if present */
+    free(user->public_key);

Review Comment:
   @necouchman I skipped the null check because free in C is null pointer safe. 
I can still add a null check though, it shouldn't do any harm but thought 
that's not required. 
   User->private_key is of type guac_common_ssh_key which includes both key and 
the optional passphrase so we call guac_common_ssh_key_free() to free the key 
whereas user->public_key is a simple char* type. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to