diff --git a/xmpp/handlers.go b/xmpp/handlers.go index ee1db21..870a292 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -258,11 +258,12 @@ func handleGetVcardTempIq(s xmpp.Sender, iq *stanza.IQ) { buf := new(bytes.Buffer) binval := base64.NewEncoder(base64.StdEncoding, buf) _, err = io.Copy(binval, file) + binval.Close() if err == nil { vcard.Photo.Type.Text = "image/jpeg" vcard.Photo.Binval.Text = buf.String() } else { - log.Errorf("Error calculating hash: %v", path) + log.Errorf("Error calculating base64: %v", path) } } else if path != "" { log.Errorf("Photo does not exist: %v", path)